SeaBattle/rust/sea_battle_backend/src/args.rs

26 lines
601 B
Rust
Raw Normal View History

2022-09-14 14:50:29 +00:00
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<String>,
}
2022-10-18 07:39:54 +00:00
#[cfg(test)]
mod test {
use crate::args::Args;
#[test]
fn verify_cli() {
use clap::CommandFactory;
Args::command().debug_assert()
}
}