delta_lib/
lib.rs

1//! `delta_lib` produces syntax-highlighed output for input from `git diff`
2//! and other subcommands such as `log`, `blame` and `grep`.
3
4extern crate bitflags;
5
6#[macro_use]
7extern crate error_chain;
8
9mod align;
10mod ansi;
11mod color;
12mod colors;
13mod edits;
14mod features;
15mod format;
16mod handlers;
17mod minusplus;
18mod options;
19mod paint;
20mod parse_style;
21mod parse_styles;
22mod style;
23mod tests;
24mod wrapping;
25
26pub mod cli;
27pub mod config;
28pub mod delta;
29pub mod env;
30pub mod git_config;
31pub mod mainfn;
32pub mod subcommands;
33pub mod utils;
34
35fn fatal<T>(errmsg: T) -> !
36where
37    T: AsRef<str> + std::fmt::Display,
38{
39    #[cfg(not(test))]
40    {
41        use std::process;
42        eprintln!("{}", errmsg);
43        // As in Config::error_exit_code: use 2 for error
44        // because diff uses 0 and 1 for non-error.
45        process::exit(2);
46    }
47    #[cfg(test)]
48    panic!("{}\n", errmsg);
49}
50
51mod errors {
52    error_chain! {
53        foreign_links {
54            Io(::std::io::Error);
55            SyntectError(::syntect::LoadingError);
56            ParseIntError(::std::num::ParseIntError);
57        }
58    }
59}