1
0
mirror of https://github.com/sharkdp/bat.git synced 2025-03-13 14:18:35 +00:00

continue to output files

This commit is contained in:
rleungx 2018-05-02 18:09:26 +08:00
parent ed09a80a73
commit f4653d9b0d

View File

@ -379,9 +379,17 @@ fn run() -> Result<()> {
})?;
if let Some(files) = app_matches.values_of("FILE") {
let mut exit = false;
for file in files {
let line_changes = get_git_diff(&file.to_string());
print_file(&options, theme, &assets.syntax_set, file, &line_changes)?;
print_file(&options, theme, &assets.syntax_set, file, &line_changes)
.unwrap_or_else(|e| {
exit = true;
eprintln!("{}: {}: {}", Red.paint("[bat error]"), file, e);
});
}
if exit {
process::exit(1);
}
}
}