diff --git a/fuzzers/fuzzbench/src/lib.rs b/fuzzers/fuzzbench/src/lib.rs index d692885f64..673758aeb9 100644 --- a/fuzzers/fuzzbench/src/lib.rs +++ b/fuzzers/fuzzbench/src/lib.rs @@ -71,22 +71,19 @@ pub fn libafl_main() { Arg::new("out") .short('o') .long("output") - .help("The directory to place finds in ('corpus')") - .takes_value(true), + .help("The directory to place finds in ('corpus')"), ) .arg( Arg::new("in") .short('i') .long("input") - .help("The directory to read initial inputs from ('seeds')") - .takes_value(true), + .help("The directory to read initial inputs from ('seeds')"), ) .arg( Arg::new("tokens") .short('x') .long("tokens") - .help("A file to read tokens from, to be used during fuzzing") - .takes_value(true), + .help("A file to read tokens from, to be used during fuzzing"), ) .arg( Arg::new("logfile") @@ -102,7 +99,7 @@ pub fn libafl_main() { .help("Timeout for each individual execution, in milliseconds") .default_value("1200"), ) - .arg(Arg::new("remaining").multiple_values(true)) + .arg(Arg::new("remaining")) .try_get_matches() { Ok(res) => res, @@ -123,8 +120,8 @@ pub fn libafl_main() { env::current_dir().unwrap().to_string_lossy().to_string() ); - if let Some(filenames) = res.values_of("remaining") { - let filenames: Vec<&str> = filenames.collect(); + if let Some(filenames) = res.get_many::("remaining") { + let filenames: Vec<&str> = filenames.map(|v| v.as_str()).collect(); if !filenames.is_empty() { run_testcases(&filenames); return; diff --git a/fuzzers/fuzzbench_text/Cargo.toml b/fuzzers/fuzzbench_text/Cargo.toml index 9d58e4754f..c46df9c300 100644 --- a/fuzzers/fuzzbench_text/Cargo.toml +++ b/fuzzers/fuzzbench_text/Cargo.toml @@ -23,7 +23,7 @@ libafl = { path = "../../libafl/" } libafl_targets = { path = "../../libafl_targets/", features = ["sancov_pcguard_hitcounts", "sancov_cmplog", "libfuzzer"] } # TODO Include it only when building cc libafl_cc = { path = "../../libafl_cc/" } -clap = { version = "3.2", features = ["default"] } +clap = { version = "4.0", features = ["default"] } nix = "0.25" mimalloc = { version = "*", default-features = false } content_inspector = "0.2.4" diff --git a/fuzzers/fuzzbench_text/src/lib.rs b/fuzzers/fuzzbench_text/src/lib.rs index 1d8b03d502..35abacbf59 100644 --- a/fuzzers/fuzzbench_text/src/lib.rs +++ b/fuzzers/fuzzbench_text/src/lib.rs @@ -77,22 +77,19 @@ pub fn libafl_main() { Arg::new("out") .short('o') .long("output") - .help("The directory to place finds in ('corpus')") - .takes_value(true), + .help("The directory to place finds in ('corpus')"), ) .arg( Arg::new("in") .short('i') .long("input") - .help("The directory to read initial inputs from ('seeds')") - .takes_value(true), + .help("The directory to read initial inputs from ('seeds')"), ) .arg( Arg::new("tokens") .short('x') .long("tokens") - .help("A file to read tokens from, to be used during fuzzing") - .takes_value(true), + .help("A file to read tokens from, to be used during fuzzing"), ) .arg( Arg::new("logfile") @@ -108,7 +105,7 @@ pub fn libafl_main() { .help("Timeout for each individual execution, in milliseconds") .default_value("1200"), ) - .arg(Arg::new("remaining").multiple_values(true)) + .arg(Arg::new("remaining")) .try_get_matches() { Ok(res) => res, @@ -129,8 +126,8 @@ pub fn libafl_main() { env::current_dir().unwrap().to_string_lossy().to_string() ); - if let Some(filenames) = res.values_of("remaining") { - let filenames: Vec<&str> = filenames.collect(); + if let Some(filenames) = res.get_many::("remaining") { + let filenames: Vec<&str> = filenames.map(|v| v.as_str()).collect(); if !filenames.is_empty() { run_testcases(&filenames); return;