diff options
Diffstat (limited to 'crates/rocie-server/src/cli.rs')
| -rw-r--r-- | crates/rocie-server/src/cli.rs | 12 |
1 files changed, 10 insertions, 2 deletions
diff --git a/crates/rocie-server/src/cli.rs b/crates/rocie-server/src/cli.rs index b2ec214..80b4292 100644 --- a/crates/rocie-server/src/cli.rs +++ b/crates/rocie-server/src/cli.rs @@ -13,8 +13,16 @@ pub(crate) enum Command { /// Serve the server. Serve { /// Which port to serve the server on. - #[arg(short, long, default_value = "8080")] - port: u16, + /// + /// Leave empty to let the OS choose a free one. + #[arg(short, long)] + port: Option<u16>, + + /// Print the used port as single u16 to stdout when started. + /// + /// This can be used, to determine the used port, when the `port` was left at `None`. + #[arg(long)] + print_port: bool, /// Which host to serve the server on. #[arg(short = 'b', long, default_value = "127.0.0.1")] |
