From d5da94fcafb0bc4ef3a892734b48cc27bb55258e Mon Sep 17 00:00:00 2001 From: Chris Aumann Date: Sun, 26 Mar 2017 18:17:58 +0200 Subject: [PATCH] Add check for conflicting --signal and --postpone arguments --- src/cli.rs | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/src/cli.rs b/src/cli.rs index 7f4e6b2d..dc74523e 100644 --- a/src/cli.rs +++ b/src/cli.rs @@ -1,7 +1,7 @@ use std::path::MAIN_SEPARATOR; use std::process::Command; -use clap::{App, Arg}; +use clap::{App, Arg, Error}; #[derive(Debug)] pub struct Args { @@ -132,6 +132,12 @@ pub fn get_args() -> Args { 1000 }; + if signal.is_some() && args.is_present("postpone") { + // TODO: Error::argument_conflict() might be the better fit, usage was unclear, though + Error::value_validation_auto(format!("--postpone and --signal are mutually exclusive")) + .exit(); + } + Args { cmd: cmd, paths: paths,