@@ -22,22 +22,11 @@ extern crate syntect;
2222extern crate wild;
2323
2424mod app;
25−mod assets;
2625mod clap_app;
27−mod config;
2826mod controller;
2927mod decorations;
30−mod diff;
31−mod dirs;
32−mod inputfile;
33−mod line_range;
3428mod output;
35−mod preprocessor;
3629mod printer;
37−mod style;
38−mod syntax_mapping;
39−mod terminal;
40−mod util;
4130
4231use std::collections::HashSet;
4332use std::io;
@@ -48,39 +37,18 @@ use std::process;
4837use ansi_term::Colour::Green;
4938use ansi_term::Style;
5039
51−use crate::app::{App, Config};
52−use crate::assets::{cache_dir, clear_assets, config_dir, HighlightingAssets};
53−use crate::config::config_file;
54−use crate::controller::Controller;
55−use crate::inputfile::InputFile;
56−use crate::style::{OutputComponent, OutputComponents};
57−
58−mod errors {
59− error_chain! {
60− foreign_links {
61− Clap(::clap::Error);
62− Io(::std::io::Error);
63− SyntectError(::syntect::LoadingError);
64− ParseIntError(::std::num::ParseIntError);
65− }
66− }
67−
68− pub fn handle_error(error: &Error) {
69− match error {
70− Error(ErrorKind::Io(ref io_error), _)
71− if io_error.kind() == super::io::ErrorKind::BrokenPipe =>
72− {
73− super::process::exit(0);
74− }
75− _ => {
76− use ansi_term::Colour::Red;
77− eprintln!("{}: {}", Red.paint("[bat error]"), error);
78− }
79− };
80− }
81−}
82−
83−use crate::errors::*;
40+use crate::{
41+ app::{App, Config},
42+ controller::Controller,
43+};
44+
45+use bat::{
46+ assets::{cache_dir, clear_assets, config_dir, HighlightingAssets},
47+ config::config_file,
48+ errors::*,
49+ inputfile::InputFile,
50+ style::{OutputComponent, OutputComponents},
51+};
8452
8553fn run_cache_subcommand(matches: &clap::ArgMatches) -> Result<()> {
8654 if matches.is_present("build") {