diff --git a/src-tauri/src/main.rs b/src-tauri/src/main.rs index b60a00a..96c0434 100644 --- a/src-tauri/src/main.rs +++ b/src-tauri/src/main.rs @@ -59,11 +59,19 @@ async fn parse_args(inp: &Vec) -> Result { args.option( "H", "host", - "Host to connect to (eg. 'localhost:443' or 'my.awesomeserver.com:6969)", + "Set host to connect to (eg. 'localhost:443' or 'my.awesomeserver.com:6969)", "SERVER_HOST", getopts::Occur::Optional, None, ); + args.option( + "a", + "game-args", + "Arguments to pass to the game process, if launching it", + r#""-opt-one -opt-two"#, + getopts::Occur::Optional, + None, + ); args.parse(inp).unwrap(); @@ -76,7 +84,8 @@ async fn parse_args(inp: &Vec) -> Result { if args.value_of("launch-game")? { let game_path = config.game_install_path; - system_helpers::run_program(game_path.to_string(), None) + let game_args: String = args.value_of("game-args")?; + system_helpers::run_program(game_path.to_string(), Some(game_args)) } if args.value_of("server")? {