diff options
Diffstat (limited to 'games')
-rw-r--r-- | games/rstnode/rst-server/src/cli.rs | 20 |
1 files changed, 20 insertions, 0 deletions
diff --git a/games/rstnode/rst-server/src/cli.rs b/games/rstnode/rst-server/src/cli.rs new file mode 100644 index 000000000000..5b74be328104 --- /dev/null +++ b/games/rstnode/rst-server/src/cli.rs @@ -0,0 +1,20 @@ +use crate::constants::{NAME, VERSION}; +use clap::{App, Arg}; +use std::path::PathBuf; + +pub fn parse() -> PathBuf { + let app = App::new(NAME) + .version(VERSION) + .author("Bread Machine (Katharina Fey <kookie@spacekookie.de>)") + .about("Stand-alone game server binary") + .arg( + Arg::with_name("assets") + .required(true) + .takes_value(true) + .default_value("./assets/maps") + .help("Path to map assets directory"), + ); + + let m = app.get_matches(); + PathBuf::new().join(m.value_of("assets").unwrap_or("./assets/maps")) +} |