1
0
mirror of https://github.com/sharkdp/bat.git synced 2024-10-06 10:51:05 +01:00

Fix all compile errors in lib.rs 🚚

* Move {controller,output,printer,decorations}.rs into src/bin/

* Add `mod errors` from main.rs
This commit is contained in:
Fahmi Akbar Wildana 2019-10-06 09:10:03 +07:00 committed by David Peter
parent eefdb186b8
commit cfd33168af
5 changed files with 26 additions and 5 deletions

View File

@ -23,16 +23,37 @@ extern crate wild;
mod assets; mod assets;
mod config; mod config;
mod controller;
mod decorations;
mod diff; mod diff;
mod dirs; mod dirs;
mod inputfile; mod inputfile;
mod line_range; mod line_range;
mod output;
mod preprocessor; mod preprocessor;
mod printer;
mod style; mod style;
mod syntax_mapping; mod syntax_mapping;
mod terminal; mod terminal;
mod util; mod util;
mod errors {
error_chain! {
foreign_links {
Clap(::clap::Error);
Io(::std::io::Error);
SyntectError(::syntect::LoadingError);
ParseIntError(::std::num::ParseIntError);
}
}
pub fn handle_error(error: &Error) {
match error {
Error(ErrorKind::Io(ref io_error), _)
if io_error.kind() == ::std::io::ErrorKind::BrokenPipe =>
{
::std::process::exit(0);
}
_ => {
use ansi_term::Colour::Red;
eprintln!("{}: {}", Red.paint("[bat error]"), error);
}
};
}
}