From 62e514e61dd3f34a38fb4aff5d99f2de41f0dd86 Mon Sep 17 00:00:00 2001 From: epi <43392618+epi052@users.noreply.github.com> Date: Mon, 31 Jan 2022 05:53:59 -0600 Subject: [PATCH] Make harness-args available to all subcommands in opt parser (#509) --- libafl/src/bolts/cli.rs | 19 ++++++++++--------- 1 file changed, 10 insertions(+), 9 deletions(-) diff --git a/libafl/src/bolts/cli.rs b/libafl/src/bolts/cli.rs index 4a70331f82..667a26964c 100644 --- a/libafl/src/bolts/cli.rs +++ b/libafl/src/bolts/cli.rs @@ -145,6 +145,15 @@ pub struct FuzzerOptions { #[clap(short = 'A', long)] pub asan: bool, + /// path to the harness + #[clap(short = 'H', long, parse(from_os_str), global = true)] + pub harness: Option, + + /// trailing arguments (after "--"); can be passed directly to the harness + #[cfg(not(feature = "qemu_cli"))] + #[clap(last = true, global = true, name = "HARNESS_ARGS")] + pub harness_args: Vec, + /// enable CmpLog instrumentation #[cfg_attr( feature = "frida_cli", @@ -210,7 +219,7 @@ pub struct FuzzerOptions { #[clap(short = 'D', long, global = true, help_heading = "Frida Options", parse(try_from_str = parse_instrumentation_location), multiple_occurrences = true)] pub dont_instrument: Option>, - /// trailing arguments (after "--") will be passed directly to QEMU + /// trailing arguments (after "--"); can be passed directly to QEMU #[cfg(feature = "qemu_cli")] #[clap(last = true, global = true)] pub qemu_args: Vec, @@ -261,14 +270,6 @@ pub enum SubCommand { #[clap(short, long, parse(from_os_str))] input_file: PathBuf, - /// path to harness - #[clap(short = 'H', long, parse(from_os_str))] - harness: Option, - - /// path to harness - #[clap(short = 'a', long, multiple_occurrences = true)] - harness_args: Option>, - /// Run the same input multiple times #[clap(short, long, default_missing_value = "1", min_values = 0)] repeat: Option,