summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorvanhauser-thc <vh@thc.org>2023-09-25 12:11:22 +0200
committervanhauser-thc <vh@thc.org>2023-09-25 12:11:22 +0200
commita18aac3d69705fc71f420468fda187f76e1293ba (patch)
treeb4af1f15e12a23760e8a809a6d51cc4ed8202ea3
parent83a8415a372d84dcc69ac1e2c2f152190bcf76d1 (diff)
downloadhonggfuzz-a18aac3d69705fc71f420468fda187f76e1293ba.tar.gz
add --version cmdline parameter
-rw-r--r--cmdline.c6
1 files changed, 5 insertions, 1 deletions
diff --git a/cmdline.c b/cmdline.c
index 19a1ad55..61910e9c 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;