diff --git a/games/rstnode/rst-server/src/cli.rs b/games/rstnode/rst-server/src/cli.rs new file mode 100644 index 00000000000..5b74be32810 --- /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 )") + .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")) +}