diff --git a/Cargo.lock b/Cargo.lock index 360c89c..4a1cd60 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -4,7 +4,7 @@ version = 4 [[package]] name = "bin2hpp" -version = "0.2.1" +version = "0.2.2" dependencies = [ "thiserror", ] diff --git a/Cargo.toml b/Cargo.toml index 018b2b6..3e35866 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "bin2hpp" -version = "0.2.1" +version = "0.2.2" authors = ["Adam Macdonald"] edition = "2024" license = "GPL-3.0-only" diff --git a/src/cfg.rs b/src/cfg.rs index 221f388..ee33c34 100644 --- a/src/cfg.rs +++ b/src/cfg.rs @@ -87,16 +87,12 @@ pub fn parse_config_from_args(args: &CliArgs) -> Result s.to_string_lossy().to_string(), - None => { - return Err(ProgramConfigError::InvalidPath( - args.input_file_path.to_string_lossy().to_string(), - )); - } + Some(s) => format!("_{}", s.to_string_lossy()), + None => "".to_string(), }; ext.retain(|c| c.is_ascii_alphanumeric()); - format!("{}_{}", stem.to_ascii_uppercase(), ext.to_ascii_uppercase()) + format!("{}{}", stem.to_ascii_uppercase(), ext.to_ascii_uppercase()) } }, namespace: match &args.namespace {