Add suggestion for arg & args (#1257)

* Add suggestion for arg & args

* Make fmt happy

* Explain @@

* Spotlight afl-fuzz

---------

Co-authored-by: Dominik Maier <domenukk@gmail.com>
Co-authored-by: Dongjia "toka" Zhang <tokazerkje@outlook.com>
This commit is contained in:
Lei Zhu 2023-05-10 19:53:40 +08:00 committed by GitHub
parent 0c7d42d28b
commit a2719cf559
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 15 additions and 1 deletions

View File

@ -256,7 +256,9 @@ where
})
}
/// Parses an AFL-like commandline, replacing `@@` with the input file.
/// Parses an AFL-like commandline, replacing `@@` with the input file
/// generated by the fuzzer (similar to the `afl-fuzz` command line).
///
/// If no `@@` was found, will use stdin for input.
/// The arg 0 is the program.
pub fn parse_afl_cmdline<IT, O>(
@ -479,12 +481,18 @@ impl CommandExecutorBuilder {
}
/// Adds an argument to the program's commandline.
///
/// You may want to use [`CommandExecutor::parse_afl_cmdline`] if you're going to pass `@@`
/// represents the input file generated by the fuzzer (similar to the `afl-fuzz` command line).
pub fn arg<O: AsRef<OsStr>>(&mut self, arg: O) -> &mut CommandExecutorBuilder {
self.args.push(arg.as_ref().to_owned());
self
}
/// Adds a range of arguments to the program's commandline.
///
/// You may want to use [`CommandExecutor::parse_afl_cmdline`] if you're going to pass `@@`
/// represents the input file generated by the fuzzer (similar to the `afl-fuzz` command line).
pub fn args<IT, O>(&mut self, args: IT) -> &mut CommandExecutorBuilder
where
IT: IntoIterator<Item = O>,

View File

@ -898,6 +898,9 @@ impl<'a, SP> ForkserverExecutorBuilder<'a, SP> {
}
/// Adds an argument to the harness's commandline
///
/// You may want to use `parse_afl_cmdline` if you're going to pass `@@`
/// represents the input file generated by the fuzzer (similar to the `afl-fuzz` command line).
#[must_use]
pub fn arg<O>(mut self, arg: O) -> Self
where
@ -908,6 +911,9 @@ impl<'a, SP> ForkserverExecutorBuilder<'a, SP> {
}
/// Adds arguments to the harness's commandline
///
/// You may want to use `parse_afl_cmdline` if you're going to pass `@@`
/// represents the input file generated by the fuzzer (similar to the `afl-fuzz` command line).
#[must_use]
pub fn args<IT, O>(mut self, args: IT) -> Self
where