From a18aac3d69705fc71f420468fda187f76e1293ba Mon Sep 17 00:00:00 2001 From: vanhauser-thc Date: Mon, 25 Sep 2023 12:11:22 +0200 Subject: [PATCH] add --version cmdline parameter --- cmdline.c | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/cmdline.c b/cmdline.c index 19a1ad55f..61910e9c7 100644 --- a/cmdline.c +++ b/cmdline.c @@ -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)" }, @@ -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;