use clap::Parser; /// Simple sea battle server #[derive(Parser, Debug, Clone)] #[clap(author, version, about, long_about = None)] pub struct Args { /// The address this server will listen to #[clap(short, long, value_parser, default_value = "0.0.0.0:7000")] pub listen_address: String, /// CORS (allowed origin) set to '*' to allow all origins #[clap(short, long, value_parser)] pub cors: Option, } #[cfg(test)] mod test { use crate::args::Args; #[test] fn verify_cli() { use clap::CommandFactory; Args::command().debug_assert() } }