0.2.2: bug fix files w/ no extension
This commit is contained in:
parent
5c098cfc98
commit
4d3f31cdc4
2
Cargo.lock
generated
2
Cargo.lock
generated
@ -4,7 +4,7 @@ version = 4
|
|||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
name = "bin2hpp"
|
name = "bin2hpp"
|
||||||
version = "0.2.1"
|
version = "0.2.2"
|
||||||
dependencies = [
|
dependencies = [
|
||||||
"thiserror",
|
"thiserror",
|
||||||
]
|
]
|
||||||
|
@ -1,6 +1,6 @@
|
|||||||
[package]
|
[package]
|
||||||
name = "bin2hpp"
|
name = "bin2hpp"
|
||||||
version = "0.2.1"
|
version = "0.2.2"
|
||||||
authors = ["Adam Macdonald"]
|
authors = ["Adam Macdonald"]
|
||||||
edition = "2024"
|
edition = "2024"
|
||||||
license = "GPL-3.0-only"
|
license = "GPL-3.0-only"
|
||||||
|
10
src/cfg.rs
10
src/cfg.rs
@ -87,16 +87,12 @@ pub fn parse_config_from_args(args: &CliArgs) -> Result<Config, ProgramConfigErr
|
|||||||
stem.retain(|c| c.is_ascii_alphanumeric());
|
stem.retain(|c| c.is_ascii_alphanumeric());
|
||||||
|
|
||||||
let mut ext: String = match args.input_file_path.extension() {
|
let mut ext: String = match args.input_file_path.extension() {
|
||||||
Some(s) => s.to_string_lossy().to_string(),
|
Some(s) => format!("_{}", s.to_string_lossy()),
|
||||||
None => {
|
None => "".to_string(),
|
||||||
return Err(ProgramConfigError::InvalidPath(
|
|
||||||
args.input_file_path.to_string_lossy().to_string(),
|
|
||||||
));
|
|
||||||
}
|
|
||||||
};
|
};
|
||||||
ext.retain(|c| c.is_ascii_alphanumeric());
|
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 {
|
namespace: match &args.namespace {
|
||||||
|
Loading…
x
Reference in New Issue
Block a user