1
0
mirror of https://github.com/sharkdp/bat synced 2026-07-21 16:43:19 +00:00

Minor --file-name code hygeine

This commit is contained in:
Kyle Criddle
2020-03-25 18:58:05 -06:00
parent 131d113ff5
commit 83772bd2cf
2 changed files with 9 additions and 16 deletions
+5 -4
View File
@@ -136,10 +136,11 @@ impl App {
}
});
if self.matches.value_of("file-name").is_some()
&& self.matches.values_of("file-name").unwrap().len() != files.len()
{
return Err("When using --file-name, each input file must have a corresponding --file-name specified.".into());
match self.matches.values_of("file-name") {
Some(filenames) if filenames.len() != files.len() => {
return Err(format!("{} {}", filenames.len(), files.len()).into());
}
_ => {}
}
Ok(Config {