diff --git a/datasette/cli.py b/datasette/cli.py index c2c03251..b71275d5 100644 --- a/datasette/cli.py +++ b/datasette/cli.py @@ -239,7 +239,12 @@ def package( "all IPs and allow access from other machines." ), ) -@click.option("-p", "--port", default=8001, help="Port for server, defaults to 8001") +@click.option( + "-p", + "--port", + default=8001, + help="Port for server, defaults to 8001. Use -p 0 to automatically assign an available port.", +) @click.option( "--debug", is_flag=True, help="Enable debug mode - useful for development" ) diff --git a/docs/datasette-serve-help.txt b/docs/datasette-serve-help.txt index e71e177d..dddade2d 100644 --- a/docs/datasette-serve-help.txt +++ b/docs/datasette-serve-help.txt @@ -10,7 +10,8 @@ Options: connections from the local machine will be allowed. Use 0.0.0.0 to listen to all IPs and allow access from other machines. - -p, --port INTEGER Port for server, defaults to 8001 + -p, --port INTEGER Port for server, defaults to 8001. Use -p 0 to automatically + assign an available port. --debug Enable debug mode - useful for development --reload Automatically reload if database or code change detected - useful for development