Add check for conflicting --signal and --postpone arguments

This commit is contained in:
Chris Aumann 2017-03-26 18:17:58 +02:00
parent 14941c89d2
commit d5da94fcaf
1 changed files with 7 additions and 1 deletions

View File

@ -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,