mirror of
https://github.com/sharkdp/bat.git
synced 2025-03-14 06:38:24 +00:00
continue to output files
This commit is contained in:
parent
ed09a80a73
commit
f4653d9b0d
10
src/main.rs
10
src/main.rs
@ -379,9 +379,17 @@ fn run() -> Result<()> {
|
|||||||
})?;
|
})?;
|
||||||
|
|
||||||
if let Some(files) = app_matches.values_of("FILE") {
|
if let Some(files) = app_matches.values_of("FILE") {
|
||||||
|
let mut exit = false;
|
||||||
for file in files {
|
for file in files {
|
||||||
let line_changes = get_git_diff(&file.to_string());
|
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);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user