diff --git a/config.md b/config.md index 4fe4f79..090844b 100644 --- a/config.md +++ b/config.md @@ -56,6 +56,7 @@ Potential range: 0<->255. ### Other things about this The format obeys the same json rules as the powders. If you are trying to get the 100% or 0% roll and the value you calculated is close to 130 or 30, change it to 130 or 30 because that is the real value. +However, if the value is negative it will be between 70%-130%. # Current issues Crafteds are not implemented \ No newline at end of file diff --git a/src/main.rs b/src/main.rs index a448b4d..b3821fa 100644 --- a/src/main.rs +++ b/src/main.rs @@ -22,7 +22,7 @@ use clap::Parser; struct Args { /// Path for config path #[arg(short, long)] - configpath: Option, + config: Option, /// Enable debug mode #[arg(short, long, default_value_t = false)] @@ -46,13 +46,13 @@ fn cook() -> Result<(), Errorfr> { debug_mode = true; println!("Debug mode enabled"); }; - let mut configpath: String = String::from("config.json"); - if let Some(configpathargs) = args.configpath { - configpath = configpathargs; + let mut config: String = String::from("config.json"); + if let Some(configpathargs) = args.config { + config = configpathargs; } // load configs - let json_config: Jsonconfig = serde_json::from_reader(fs::File::open(configpath) + let json_config: Jsonconfig = serde_json::from_reader(fs::File::open(config) .map_err(|_| Errorfr::ItemJsonMissing)?) .map_err(|e| Errorfr::ItemJsonCorrupt(e))?; let idsmap: HashMap = serde_json::from_reader(fs::File::open("id_keys.json")