parent
4bbd0b2137
commit
c6e4921512
@ -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")) |
||||
} |
Loading…
Reference in new issue