Validation for --port, closes #1226

This commit is contained in:
Simon Willison 2021-02-18 10:05:27 -08:00
commit 36a44bffbf
2 changed files with 10 additions and 0 deletions

View file

@ -223,6 +223,7 @@ def plugins(all, plugins_dir):
"-p",
"--port",
default=8001,
type=click.IntRange(1, 65535),
help="Port to run the server on, defaults to 8001",
)
@click.option("--title", help="Title for metadata")
@ -329,6 +330,7 @@ def uninstall(packages, yes):
"-p",
"--port",
default=8001,
type=click.IntRange(0, 65535),
help="Port for server, defaults to 8001. Use -p 0 to automatically assign an available port.",
)
@click.option(