From c6e4921512f576b06c411823c5d88e0dca5b556d Mon Sep 17 00:00:00 2001 From: Katharina Fey Date: Fri, 26 Feb 2021 22:55:29 +0100 Subject: [PATCH] rstnode: implement basic layered event handlers --- games/rstnode/rst-server/src/cli.rs | 20 ++++++++++++++++++++ 1 file changed, 20 insertions(+) create mode 100644 games/rstnode/rst-server/src/cli.rs 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")) +}