use std::path::PathBuf;
use structopt::clap::ArgGroup;
use structopt::StructOpt;
use crate::controllers::cmd_setup_async::SetupController;
#[derive(StructOpt, Debug)]
pub enum SetUp {
#[structopt(after_help = SetupController::show_help_setup())]
Config {
#[structopt(short = "l", long = "label")]
label: String,
#[structopt(short = "v", long = "value")]
value: String,
},
Reset {},
}
#[derive(StructOpt, Debug)]
#[structopt(name = "quicktest")]
pub enum Opt {
Stress {
#[structopt(short = "t", long = "target-file", parse(from_os_str))]
target_file: PathBuf,
#[structopt(short = "g", long = "gen-file", parse(from_os_str), default_value = "")]
gen_file: PathBuf,
#[structopt(long = "timeout", alias = "tout", default_value = "2000")]
timeout: u32,
#[structopt(long = "memory-limit", alias = "ml", default_value = "1000000000")]
memory_limit: u64,
#[structopt(long = "test-cases", alias = "tc", default_value = "1000")]
test_cases: u32,
#[structopt(short = "p", long = "prefix", default_value = "")]
prefix: String,
#[structopt(short = "b", alias = "break", long = "break-bad")]
break_bad: bool,
#[structopt(long = "save-bad", conflicts_with = "save-all")]
save_bad: bool,
#[structopt(long = "save-all", conflicts_with = "save-bad")]
save_all: bool,
#[structopt(long = "run-all")]
run_all: bool,
#[structopt(long = "run-ac")]
run_ac: bool,
#[structopt(long = "run-wa")]
run_wa: bool,
#[structopt(long = "run-tle")]
run_tle: bool,
#[structopt(long = "run-rte")]
run_rte: bool,
#[structopt(long = "run-mle")]
run_mle: bool,
},
Cmp {
#[structopt(short = "t", long = "target-file", parse(from_os_str))]
target_file: PathBuf,
#[structopt(short = "c", long = "correct-file", parse(from_os_str))]
correct_file: PathBuf,
#[structopt(short = "g", long = "gen-file", parse(from_os_str), default_value = "")]
gen_file: PathBuf,
#[structopt(long = "timeout", alias = "tout", default_value = "2000")]
timeout: u32,
#[structopt(long = "memory-limit", alias = "ml", default_value = "1000000000")]
memory_limit: u64,
#[structopt(long = "test-cases", alias = "tc", default_value = "1000")]
test_cases: u32,
#[structopt(short = "p", long = "prefix", default_value = "")]
prefix: String,
#[structopt(short = "b", alias = "break", long = "break-bad")]
break_bad: bool,
#[structopt(long = "save-bad", conflicts_with = "save-all")]
save_bad: bool,
#[structopt(long = "save-all", conflicts_with = "save-bad")]
save_all: bool,
#[structopt(long = "run-all")]
run_all: bool,
#[structopt(long = "run-ac")]
run_ac: bool,
#[structopt(long = "run-wa")]
run_wa: bool,
#[structopt(long = "run-tle")]
run_tle: bool,
#[structopt(long = "run-mle")]
run_mle: bool,
#[structopt(long = "run-rte")]
run_rte: bool,
#[structopt(short = "d", long = "diff")]
diff: bool,
},
Check {
#[structopt(short = "t", long = "target-file", parse(from_os_str))]
target_file: PathBuf,
#[structopt(short = "c", long = "checker-file", parse(from_os_str))]
checker_file: PathBuf,
#[structopt(short = "g", long = "gen-file", parse(from_os_str), default_value = "")]
gen_file: PathBuf,
#[structopt(long = "timeout", alias = "tout", default_value = "2000")]
timeout: u32,
#[structopt(long = "memory-limit", alias = "ml", default_value = "1000000000")]
memory_limit: u64,
#[structopt(long = "test-cases", alias = "tc", default_value = "1000")]
test_cases: u32,
#[structopt(short = "p", long = "prefix", default_value = "")]
prefix: String,
#[structopt(short = "b", alias = "break", long = "break_bad")]
break_bad: bool,
#[structopt(long = "save-bad", conflicts_with = "save-all")]
save_bad: bool,
#[structopt(long = "save-all", conflicts_with = "save-bad")]
save_all: bool,
#[structopt(long = "run-all")]
run_all: bool,
#[structopt(long = "run-ac")]
run_ac: bool,
#[structopt(long = "run-wa")]
run_wa: bool,
#[structopt(long = "run-tle")]
run_tle: bool,
#[structopt(long = "run-rte")]
run_rte: bool,
#[structopt(long = "run-mle")]
run_mle: bool,
},
Output {
#[structopt(short = "t", long = "target-file", parse(from_os_str))]
target_file: PathBuf,
#[structopt(short = "p", long = "prefix")]
prefix: String,
#[structopt(long = "timeout", alias = "tout", default_value = "2000")]
timeout: u32,
#[structopt(long = "memory-limit", alias = "ml", default_value = "1000000000")]
memory_limit: u64,
#[structopt(short = "b", alias = "break", long = "break-bad")]
break_bad: bool,
#[structopt(long = "save-out")]
save_out: bool,
},
Setup {
#[structopt(subcommand)]
subcommand: SetUp,
},
#[structopt(group = ArgGroup::with_name("cmd").required(true))]
Example {
#[structopt(long = "stress", group = "cmd")]
stress: bool,
#[structopt(long = "cmp", group = "cmd")]
cmp: bool,
#[structopt(long = "check", group = "cmd")]
check: bool,
#[structopt(long = "output", group = "cmd")]
output: bool,
#[structopt(long = "setup", group = "cmd")]
setup: bool,
},
}