Add check for conflicting --signal and --postpone arguments
This commit is contained in:
parent
14941c89d2
commit
d5da94fcaf
|
@ -1,7 +1,7 @@
|
||||||
use std::path::MAIN_SEPARATOR;
|
use std::path::MAIN_SEPARATOR;
|
||||||
use std::process::Command;
|
use std::process::Command;
|
||||||
|
|
||||||
use clap::{App, Arg};
|
use clap::{App, Arg, Error};
|
||||||
|
|
||||||
#[derive(Debug)]
|
#[derive(Debug)]
|
||||||
pub struct Args {
|
pub struct Args {
|
||||||
|
@ -132,6 +132,12 @@ pub fn get_args() -> Args {
|
||||||
1000
|
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 {
|
Args {
|
||||||
cmd: cmd,
|
cmd: cmd,
|
||||||
paths: paths,
|
paths: paths,
|
||||||
|
|
Loading…
Reference in New Issue