diff options
author | Marcello Stanisci <stanisci.m@gmail.com> | 2019-03-05 14:43:26 +0100 |
---|---|---|
committer | Marcello Stanisci <stanisci.m@gmail.com> | 2019-03-05 14:43:26 +0100 |
commit | 17ac7add26c7af81c3f50fce71d086de33f2e754 (patch) | |
tree | aa46ac2572bc1d3362c00454cb0550a3dc99942b /src/merchant-tools/taler-merchant-benchmark.c | |
parent | 9bf941792d5d093a51d811f5e2595ca5b718cdb0 (diff) |
Fix argument parsing.
Diffstat (limited to 'src/merchant-tools/taler-merchant-benchmark.c')
-rw-r--r-- | src/merchant-tools/taler-merchant-benchmark.c | 27 |
1 files changed, 19 insertions, 8 deletions
diff --git a/src/merchant-tools/taler-merchant-benchmark.c b/src/merchant-tools/taler-merchant-benchmark.c index 4d6297a6..bb6591f2 100644 --- a/src/merchant-tools/taler-merchant-benchmark.c +++ b/src/merchant-tools/taler-merchant-benchmark.c @@ -702,15 +702,19 @@ main (int argc, }; options = root_options; - if (0 == strcmp ("ordinary", argv[1])) - { - ordinary = GNUNET_YES; - options = ordinary_options; - } - if (0 == strcmp ("corner", argv[1])) + + if (NULL != argv[1]) { - corner = GNUNET_YES; - options = corner_options; + if (0 == strcmp ("ordinary", argv[1])) + { + ordinary = GNUNET_YES; + options = ordinary_options; + } + if (0 == strcmp ("corner", argv[1])) + { + corner = GNUNET_YES; + options = corner_options; + } } if (GNUNET_SYSERR != (result = GNUNET_GETOPT_run @@ -736,6 +740,13 @@ main (int argc, return 1; } + if ((GNUNET_YES != ordinary) || (GNUNET_YES != corner)) + { + fprintf (stderr, + "Please use 'ordinary' or 'corner' subcommands.\n"); + return 1; + } + if ((GNUNET_YES == corner) && (NULL == alt_instance)) { fprintf (stderr, "option '-i' is mandatory" |