Make harness-args available to all subcommands in opt parser (#509)

This commit is contained in:
epi 2022-01-31 05:53:59 -06:00 committed by GitHub
parent 4862928e1e
commit 62e514e61d
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -145,6 +145,15 @@ pub struct FuzzerOptions {
#[clap(short = 'A', long)] #[clap(short = 'A', long)]
pub asan: bool, pub asan: bool,
/// path to the harness
#[clap(short = 'H', long, parse(from_os_str), global = true)]
pub harness: Option<PathBuf>,
/// 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<String>,
/// enable CmpLog instrumentation /// enable CmpLog instrumentation
#[cfg_attr( #[cfg_attr(
feature = "frida_cli", 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)] #[clap(short = 'D', long, global = true, help_heading = "Frida Options", parse(try_from_str = parse_instrumentation_location), multiple_occurrences = true)]
pub dont_instrument: Option<Vec<(String, usize)>>, pub dont_instrument: Option<Vec<(String, usize)>>,
/// trailing arguments (after "--") will be passed directly to QEMU /// trailing arguments (after "--"); can be passed directly to QEMU
#[cfg(feature = "qemu_cli")] #[cfg(feature = "qemu_cli")]
#[clap(last = true, global = true)] #[clap(last = true, global = true)]
pub qemu_args: Vec<String>, pub qemu_args: Vec<String>,
@ -261,14 +270,6 @@ pub enum SubCommand {
#[clap(short, long, parse(from_os_str))] #[clap(short, long, parse(from_os_str))]
input_file: PathBuf, input_file: PathBuf,
/// path to harness
#[clap(short = 'H', long, parse(from_os_str))]
harness: Option<PathBuf>,
/// path to harness
#[clap(short = 'a', long, multiple_occurrences = true)]
harness_args: Option<Vec<String>>,
/// Run the same input multiple times /// Run the same input multiple times
#[clap(short, long, default_missing_value = "1", min_values = 0)] #[clap(short, long, default_missing_value = "1", min_values = 0)]
repeat: Option<usize>, repeat: Option<usize>,