use std::path::PathBuf; use clap::{Parser, Subcommand}; #[derive(Parser)] pub(crate) struct CliArgs { #[command(subcommand)] pub(crate) command: Command, } #[derive(Subcommand)] pub(crate) enum Command { /// Serve the server. Serve { /// Which port to serve the server on. /// /// Leave empty to let the OS choose a free one. #[arg(short, long)] port: Option, /// 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")] host: String, /// Path to the database to use to store data. #[arg(short, long, env = "ROCIE_DB_PATH")] db_path: PathBuf, }, /// Print the `OpenAPI` API documentation to stdout. OpenApi, }