Add color to bin/gen
error messages
type: development
This commit is contained in:
parent
8dfdbe43df
commit
60a72cf057
1
Cargo.lock
generated
1
Cargo.lock
generated
|
@ -358,6 +358,7 @@ checksum = "2fad85553e09a6f881f739c29f0b00b0f01357c743266d478b68951ce23285f3"
|
||||||
name = "gen"
|
name = "gen"
|
||||||
version = "0.0.0"
|
version = "0.0.0"
|
||||||
dependencies = [
|
dependencies = [
|
||||||
|
"ansi_term 0.12.1",
|
||||||
"askama",
|
"askama",
|
||||||
"cargo_toml",
|
"cargo_toml",
|
||||||
"chrono",
|
"chrono",
|
||||||
|
|
|
@ -6,6 +6,7 @@ edition = "2018"
|
||||||
publish = false
|
publish = false
|
||||||
|
|
||||||
[dependencies]
|
[dependencies]
|
||||||
|
ansi_term = "0.12.1"
|
||||||
askama = "0.9.0"
|
askama = "0.9.0"
|
||||||
cargo_toml = "0.8.0"
|
cargo_toml = "0.8.0"
|
||||||
chrono = "0.4.11"
|
chrono = "0.4.11"
|
||||||
|
@ -13,6 +14,7 @@ fehler = "1.0.0"
|
||||||
git2 = "0.13.1"
|
git2 = "0.13.1"
|
||||||
globset = "0.4.5"
|
globset = "0.4.5"
|
||||||
ignore = "0.4.14"
|
ignore = "0.4.14"
|
||||||
|
lexiclean = "0.0.1"
|
||||||
libc = "0.2.69"
|
libc = "0.2.69"
|
||||||
log = "0.4.8"
|
log = "0.4.8"
|
||||||
pretty_env_logger = "0.4.0"
|
pretty_env_logger = "0.4.0"
|
||||||
|
@ -24,7 +26,6 @@ strum = "0.18.0"
|
||||||
strum_macros = "0.18.0"
|
strum_macros = "0.18.0"
|
||||||
tempfile = "3.1.0"
|
tempfile = "3.1.0"
|
||||||
walkdir = "2.3.1"
|
walkdir = "2.3.1"
|
||||||
lexiclean = "0.0.1"
|
|
||||||
|
|
||||||
[dependencies.serde]
|
[dependencies.serde]
|
||||||
version = "1.0.106"
|
version = "1.0.106"
|
||||||
|
|
|
@ -11,6 +11,7 @@ pub(crate) use std::{
|
||||||
str,
|
str,
|
||||||
};
|
};
|
||||||
|
|
||||||
|
pub(crate) use ansi_term::Style;
|
||||||
pub(crate) use askama::Template;
|
pub(crate) use askama::Template;
|
||||||
pub(crate) use cargo_toml::Manifest;
|
pub(crate) use cargo_toml::Manifest;
|
||||||
pub(crate) use chrono::{DateTime, NaiveDateTime, Utc};
|
pub(crate) use chrono::{DateTime, NaiveDateTime, Utc};
|
||||||
|
|
|
@ -34,7 +34,9 @@ fn main() {
|
||||||
pretty_env_logger::init();
|
pretty_env_logger::init();
|
||||||
|
|
||||||
if let Err(error) = Opt::from_args().run() {
|
if let Err(error) = Opt::from_args().run() {
|
||||||
eprintln!("{}", error);
|
let bold = Style::new().bold();
|
||||||
|
let red = Style::new().fg(ansi_term::Color::Red).bold();
|
||||||
|
eprintln!("{}: {}", red.paint("error"), bold.paint(error.to_string()));
|
||||||
process::exit(EXIT_FAILURE);
|
process::exit(EXIT_FAILURE);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue
Block a user