0.2.2: bug fix files w/ no extension
This commit is contained in:
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());
|
||||
|
||||
let mut ext: String = match args.input_file_path.extension() {
|
||||
Some(s) => 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 {
|
||||
|
||||
Reference in New Issue
Block a user