SeaBattle/rust/sea_battle_backend/src/args.rs
Pierre Hubert e88d64ff63
All checks were successful
continuous-integration/drone/push Build is passing
continuous-integration/drone/tag Build is passing
Bump to version 0.1.0 -> 0.2.0
2022-10-18 09:39:54 +02:00

26 lines
601 B
Rust

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>,
}
#[cfg(test)]
mod test {
use crate::args::Args;
#[test]
fn verify_cli() {
use clap::CommandFactory;
Args::command().debug_assert()
}
}