diff --git a/src/lib.rs b/src/lib.rs index 30e1587..ac6aa09 100644 --- a/src/lib.rs +++ b/src/lib.rs @@ -52,7 +52,7 @@ pub fn get_steam_location() -> String { // linux: ~/.local/share/Steam match std::env::consts::OS { "linux" => String::from(format!("{}/.local/share/Steam", get_home())), - "windows" => String::from("C:\\Program Files (x86)\\Steam"), + "windows" => String::from("C:/Program Files (x86)/Steam"), _ => panic!( "if ya tell me what OS you're on and where your steam location is, i can fix this" ), @@ -63,7 +63,7 @@ pub fn get_config_location() -> String { // linux: ~/.config match std::env::consts::OS { "linux" => String::from(format!("{}/.config", get_home())), - "windows" => String::from(format!("{}\\AppData\\Roaming", get_home())), + "windows" => String::from(format!("{}/AppData/Roaming", get_home())), _ => String::from(format!("{}/.config", get_home())), } } diff --git a/src/main.rs b/src/main.rs index 4b81f8e..b70fae7 100644 --- a/src/main.rs +++ b/src/main.rs @@ -7,11 +7,19 @@ fn main() { let cfg = cyber_mod_manager::read_config(&format!("{config_location}/CyberModManager/config.json")); - match &env::args().collect::>()[1][..] { - "deploy" => cyber_mod_manager::deploy(cfg), - "undeploy" => cyber_mod_manager::undeploy(cfg), - "unzip" => cyber_mod_manager::unzip(cfg), - "openfolder" => opener::open(cfg.archives).unwrap(), - _ => panic!("arg not supported") + let args = env::args().collect::>(); + let helpstring = "cybermodmanager, written by sadlynotsappho (https://sadlynotsappho.dev)\n - deploy: deploys the mods to the game folder\n - undeploy: you're smart enough to figure this one out\n - unzip: unzips the archives placed in the archives folder\n - openfolder: opens the archives folder"; + if args.len() == 1 { + println!("{helpstring}"); + } else if args.len() >= 2 { + match &args[1][..] { + "deploy" => cyber_mod_manager::deploy(cfg), + "undeploy" => cyber_mod_manager::undeploy(cfg), + "unzip" => cyber_mod_manager::unzip(cfg), + "openfolder" => opener::open(cfg.archives).unwrap(), + "help" => println!("{helpstring}"), + "--help" => println!("{helpstring}"), + _ => panic!("arg not supported") + } } }