diff options
author | Daniel Baumann <daniel.baumann@progress-linux.org> | 2023-03-12 10:11:05 +0000 |
---|---|---|
committer | Daniel Baumann <daniel.baumann@progress-linux.org> | 2023-03-12 10:11:05 +0000 |
commit | 6ae3a5d13193d2b2ca6caba17ad7898d9c54b4f5 (patch) | |
tree | 50423e9204083803a7a8701188dacea3b441b477 /src | |
parent | Adding upstream version 2.11.0. (diff) | |
download | dnsperf-6ae3a5d13193d2b2ca6caba17ad7898d9c54b4f5.tar.xz dnsperf-6ae3a5d13193d2b2ca6caba17ad7898d9c54b4f5.zip |
Adding upstream version 2.11.1.upstream/2.11.1
Signed-off-by: Daniel Baumann <daniel.baumann@progress-linux.org>
Diffstat (limited to 'src')
-rw-r--r-- | src/opt.c | 8 | ||||
-rwxr-xr-x | src/test/test1.sh | 3 |
2 files changed, 9 insertions, 2 deletions
@@ -240,7 +240,7 @@ static int perf_opt_long_parse(char* optarg) if ((arg = strchr(optarg, '='))) { arg++; - optlen = arg - optarg; + optlen = strlen(arg); if (optlen < 1) { return -1; } @@ -305,7 +305,11 @@ void perf_long_opt_usage(void) fprintf(stderr, "Usage: %s ... -O <name>[=<value>] ...\n\nAvailable long options:\n", progname); long_opt_t* opt = longopts; while (opt) { - fprintf(stderr, " %s%s: %s", opt->name, opt->type != perf_opt_boolean ? "=<val>" : "", opt->help); + if (opt->type == perf_opt_boolean) { + fprintf(stderr, " %s: %s", opt->name, opt->help); + } else { + fprintf(stderr, " %s=<%s>: %s", opt->name, opt->desc ? opt->desc : "val", opt->help); + } if (opt->defval) { fprintf(stderr, " (default: %s)", opt->defval); } diff --git a/src/test/test1.sh b/src/test/test1.sh index cd6af3c..a289c99 100755 --- a/src/test/test1.sh +++ b/src/test/test1.sh @@ -7,3 +7,6 @@ ! ../dnsperf -O suppress= ! ../resperf -O suppress ! ../resperf -O suppress= + +# test for broken long opt in v2.11.0 +../dnsperf -O suppress=test 2>&1 |grep -q "unknown message type to suppress: test" |