From 41a5ff039be920d9013d6bfc5e863bbbd805dae4 Mon Sep 17 00:00:00 2001 From: Sindre Johansen Date: Sun, 21 Oct 2018 18:24:55 +0200 Subject: [PATCH] Only use the last argument of {style,plain,number} --- src/clap_app.rs | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/src/clap_app.rs b/src/clap_app.rs index 15498aed..13d2b4e2 100644 --- a/src/clap_app.rs +++ b/src/clap_app.rs @@ -104,6 +104,8 @@ pub fn build_app(interactive_output: bool) -> ClapApp<'static, 'static> { .use_delimiter(false) .takes_value(true) .overrides_with("style") + .overrides_with("plain") + .overrides_with("number") // Cannot use clap's built in validation because we have to turn off clap's delimiters .validator(|val| { let mut invalid_vals = val.split(",").filter(|style| { @@ -136,10 +138,10 @@ pub fn build_app(interactive_output: bool) -> ClapApp<'static, 'static> { .arg( Arg::with_name("plain") .overrides_with("plain") + .overrides_with("number") .short("p") .long("plain") - .conflicts_with("style") - .conflicts_with("number") + // .conflicts_with("style") .help("Show plain style (alias for '--style=plain').") .long_help( "Only show plain style, no decorations. This is an alias for \ @@ -151,7 +153,6 @@ pub fn build_app(interactive_output: bool) -> ClapApp<'static, 'static> { .long("number") .overrides_with("number") .short("n") - .conflicts_with("style") .help("Show line numbers (alias for '--style=numbers').") .long_help( "Only show line numbers, no other decorations. This is an alias for \