summaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorEric Nielsen <eric@amalgamar.com.br>2017-05-25 17:32:21 -0500
committerAndrew Gallant <jamslam@gmail.com>2017-05-26 07:00:58 -0400
commitff898cd1056f4fc23181edbadb7fb495ae9646ef (patch)
treefde0e0889d08b0d7b8d7cf28c28d4fb68e8ac0dc /src
parent2c98e5ce1eec741bf55df655c74b9d64ee5c7703 (diff)
Remove vestigial color function from src/args.rs
It's usage was replaced by the `color_choice` function. Also, `color` was outdated, as it didn't include testing for the new "ansi" option.
Diffstat (limited to 'src')
-rw-r--r--src/args.rs19
1 files changed, 0 insertions, 19 deletions
diff --git a/src/args.rs b/src/args.rs
index cc3f739f..703ab3b5 100644
--- a/src/args.rs
+++ b/src/args.rs
@@ -35,7 +35,6 @@ pub struct Args {
paths: Vec<PathBuf>,
after_context: usize,
before_context: usize,
- color: bool,
color_choice: termcolor::ColorChoice,
colors: ColorSpecs,
column: bool,
@@ -317,7 +316,6 @@ impl<'a> ArgMatches<'a> {
paths: paths,
after_context: after_context,
before_context: before_context,
- color: self.color(),
color_choice: self.color_choice(),
colors: try!(self.color_specs()),
column: self.column(),
@@ -665,23 +663,6 @@ impl<'a> ArgMatches<'a> {
})
}
- /// Returns true if and only if ripgrep should color its output.
- fn color(&self) -> bool {
- let preference = match self.0.value_of_lossy("color") {
- None => "auto".to_string(),
- Some(v) => v.into_owned(),
- };
- if preference == "always" {
- true
- } else if self.is_present("vimgrep") {
- false
- } else if preference == "auto" {
- atty::is(atty::Stream::Stdout) || self.is_present("pretty")
- } else {
- false
- }
- }
-
/// Returns the user's color choice based on command line parameters and
/// environment.
fn color_choice(&self) -> termcolor::ColorChoice {