Skip to content

Commit

Permalink
add --version cmdline parameter
Browse files Browse the repository at this point in the history
  • Loading branch information
vanhauser-thc committed Sep 25, 2023
1 parent 83a8415 commit a18aac3
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion cmdline.c
Original file line number Diff line number Diff line change
Expand Up @@ -486,6 +486,7 @@ bool cmdlineParse(int argc, char* argv[], honggfuzz_t* hfuzz) {
{ { "stdin_input", no_argument, NULL, 's' }, "Provide fuzzing input on STDIN, instead of " _HF_FILE_PLACEHOLDER },
{ { "mutations_per_run", required_argument, NULL, 'r' }, "Maximal number of mutations per one run (default: 6)" },
{ { "logfile", required_argument, NULL, 'l' }, "Log file" },
{ { "version", no_argument, NULL, '!' }, "Just how the version and exit" },
{ { "verbose", no_argument, NULL, 'v' }, "Disable ANSI console; use simple log output" },
{ { "verifier", no_argument, NULL, 'V' }, "Enable crashes verifier" },
{ { "debug", no_argument, NULL, 'd' }, "Show debug messages (level >= 4)" },
Expand Down Expand Up @@ -570,12 +571,15 @@ bool cmdlineParse(int argc, char* argv[], honggfuzz_t* hfuzz) {
int opt_index = 0;
for (;;) {
int c = getopt_long(
argc, argv, "-?hQvVsuUPxf:i:o:dqe:W:r:c:F:t:R:n:N:l:p:g:E:w:B:zMTS", opts, &opt_index);
argc, argv, "-?!hQvVsuUPxf:i:o:dqe:W:r:c:F:t:R:n:N:l:p:g:E:w:B:zMTS", opts, &opt_index);
if (c < 0) {
break;
}

switch (c) {
case '!':
LOG_HELP(PROG_NAME " " PROG_VERSION);
exit(0);
case 'h':
cmdlineUsage(argv[0], custom_opts);
break;
Expand Down

0 comments on commit a18aac3

Please sign in to comment.