@@ -22,22 +22,11 @@ extern crate syntect;
22extern crate wild;
22extern crate wild;
26mod clap_app;
25mod clap_app;
28mod controller;
26mod controller;
29mod decorations;
27mod decorations;
34mod output;
28mod output;
36mod printer;
29mod printer;
42use std::collections::HashSet;
31use std::collections::HashSet;
43use std::io;
32use std::io;
@@ -48,39 +37,18 @@ use std::process;
48use ansi_term::Colour::Green;
37use ansi_term::Colour::Green;
49use ansi_term::Style;
38use ansi_term::Style;
51−use crate::app::{App, Config};
41+ app::{App, Config},
42+ controller::Controller,
52−use crate::assets::{cache_dir, clear_assets, config_dir, HighlightingAssets};
46+ assets::{cache_dir, clear_assets, config_dir, HighlightingAssets},
53−use crate::config::config_file;
47+ config::config_file,
54−use crate::controller::Controller;
48+ errors::*,
55−use crate::inputfile::InputFile;
49+ inputfile::InputFile,
56−use crate::style::{OutputComponent, OutputComponents};
50+ style::{OutputComponent, OutputComponents},
62− Io(::std::io::Error);
63− SyntectError(::syntect::LoadingError);
64− ParseIntError(::std::num::ParseIntError);
68− pub fn handle_error(error: &Error) {
70− Error(ErrorKind::Io(ref io_error), _)
71− if io_error.kind() == super::io::ErrorKind::BrokenPipe =>
73− super::process::exit(0);
76− use ansi_term::Colour::Red;
77− eprintln!("{}: {}", Red.paint("[bat error]"), error);
85fn run_cache_subcommand(matches: &clap::ArgMatches) -> Result<()> {
53fn run_cache_subcommand(matches: &clap::ArgMatches) -> Result<()> {
86 if matches.is_present("build") {
54 if matches.is_present("build") {