Activate test mode

This commit is contained in:
Fabrice Reix 2021-07-28 21:29:40 +02:00
parent 7b7a08ff37
commit 828c64b440
2 changed files with 18 additions and 3 deletions

View File

@ -269,6 +269,10 @@ Print filename and status for each test
Print test metrics at the end of the run
### --test {#test}
Activate test mode; equals --output /dev/null --progress --summary
### -x, --proxy [protocol://]host[:port] {#proxy}

View File

@ -207,6 +207,11 @@ pub fn app() -> clap::App<'static, 'static> {
.long("summary")
.help("Print test metrics at the end of the run"),
)
.arg(
clap::Arg::with_name("test")
.long("test")
.help("Activate test mode; equals --output /dev/null --progress --summary"),
)
.arg(
clap::Arg::with_name("to_entry")
.long("to-entry")
@ -313,10 +318,16 @@ pub fn parse_options(matches: ArgMatches) -> Result<CliOptions, CliError> {
},
};
let no_proxy = matches.value_of("proxy").map(|x| x.to_string());
let output = matches.value_of("output").map(|x| x.to_string());
let progress = matches.is_present("progress");
let output = if let Some(filename) = matches.value_of("output") {
Some(filename.to_string())
} else if matches.is_present("test") {
Some("/dev/null".to_string())
} else {
None
};
let progress = matches.is_present("progress") || matches.is_present("test");
let proxy = matches.value_of("proxy").map(|x| x.to_string());
let summary = matches.is_present("summary");
let summary = matches.is_present("summary") || matches.is_present("test");
let timeout = match matches.value_of("max_time") {
None => ClientOptions::default().timeout,
Some(s) => match s.parse::<u64>() {