aboutsummaryrefslogtreecommitdiff
path: root/src/main.rs
diff options
context:
space:
mode:
authorDaniel <kingdread@gmx.de>2018-09-10 00:19:50 +0200
committerDaniel <kingdread@gmx.de>2018-09-10 00:19:50 +0200
commitab639eea67e830ab27f51adb2665c73d93c682c7 (patch)
treee3798e9213b95f9f18c7030fd413b037c38b20d9 /src/main.rs
parent8d58f0ade28e07c0d5d885478ba211fce7c05305 (diff)
downloadraidgrep-ab639eea67e830ab27f51adb2665c73d93c682c7.tar.gz
raidgrep-ab639eea67e830ab27f51adb2665c73d93c682c7.tar.bz2
raidgrep-ab639eea67e830ab27f51adb2665c73d93c682c7.zip
add a flag to disable colored output
Diffstat (limited to 'src/main.rs')
-rw-r--r--src/main.rs9
1 files changed, 9 insertions, 0 deletions
diff --git a/src/main.rs b/src/main.rs
index 31e29ad..9343e14 100644
--- a/src/main.rs
+++ b/src/main.rs
@@ -49,6 +49,10 @@ struct Opt {
#[structopt(short = "o", long = "outcome")]
outcome: Option<FightOutcome>,
+ /// Disable colored output.
+ #[structopt(long = "no-color")]
+ no_color: bool,
+
/// The regular expression to search for.
#[structopt(name = "EXPR")]
expression: Regex,
@@ -141,6 +145,11 @@ impl FromStr for FightOutcome {
fn main() {
let opt = Opt::from_args();
+
+ if opt.no_color {
+ colored::control::set_override(false);
+ }
+
let result = grep(&opt);
match result {
Ok(_) => {}