Skip to content

Commit

Permalink
add addseeds command
Browse files Browse the repository at this point in the history
  • Loading branch information
vanhauser-thc authored and smoelius committed Nov 10, 2023
1 parent 8130881 commit 4bd416f
Showing 1 changed file with 20 additions and 0 deletions.
20 changes: 20 additions & 0 deletions cargo-afl/src/bin/cargo-afl.rs
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,12 @@ fn main() {
let afl_matches = app_matches.subcommand_matches("afl").unwrap();

match afl_matches.subcommand() {
Some(("addseeds", sub_matches)) => {
let args = sub_matches
.get_many::<OsString>("afl-addseeds args")
.unwrap_or_default();
run_afl(args, "afl-addseeds");
}
Some(("analyze", sub_matches)) => {
let args = sub_matches
.get_many::<OsString>("afl-analyze args")
Expand Down Expand Up @@ -109,6 +115,19 @@ fn clap_app() -> clap::Command {
.external_subcommand_value_parser(value_parser!(OsString))
.override_usage("cargo afl [SUBCOMMAND or Cargo SUBCOMMAND]")
.after_help(help)
.subcommand(
Command::new("addseeds")
.about("Invoke afl-addseeds")
.allow_hyphen_values(true)
.disable_help_subcommand(true)
.disable_help_flag(true)
.disable_version_flag(true)
.arg(
Arg::new("afl-addseeds args")
.value_parser(value_parser!(OsString))
.num_args(0..),
),
)
.subcommand(
Command::new("analyze")
.about("Invoke afl-analyze")
Expand Down Expand Up @@ -420,6 +439,7 @@ mod tests {
}

const SUBCOMMANDS: &[&str] = &[
"addseeds",
"analyze",
"cmin",
"fuzz",
Expand Down

0 comments on commit 4bd416f

Please sign in to comment.