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 cli;
12mod color;
13mod colors;
14mod config;
15mod delta;
16mod edits;
17mod env;
18mod features;
19mod format;
20mod git_config;
21mod handlers;
22mod minusplus;
23mod options;
24mod paint;
25mod parse_style;
26mod parse_styles;
27mod style;
28mod subcommands;
29mod tests;
30mod utils;
31mod wrapping;
32
33pub mod mainfn;
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}