diff options
-rw-r--r-- | src/main.rs | 9 |
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(_) => {} |