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 | |
parent | 9bf941792d5d093a51d811f5e2595ca5b718cdb0 (diff) | |
download | merchant-17ac7add26c7af81c3f50fce71d086de33f2e754.tar.gz merchant-17ac7add26c7af81c3f50fce71d086de33f2e754.tar.bz2 merchant-17ac7add26c7af81c3f50fce71d086de33f2e754.zip |
Fix argument parsing.
-rw-r--r-- | src/merchant-tools/README | 9 | ||||
-rw-r--r-- | src/merchant-tools/taler-merchant-benchmark.c | 27 |
2 files changed, 21 insertions, 15 deletions
diff --git a/src/merchant-tools/README b/src/merchant-tools/README index d84ca59d..596d5da8 100644 --- a/src/merchant-tools/README +++ b/src/merchant-tools/README @@ -1,4 +1,3 @@ - ** Taler Merchant Payments Generator ** === INTRODUCTION === @@ -10,7 +9,7 @@ payments to be in place. It is mandatory to give it a config file that contains information about the setup to target. Note that the merchant and the exchange -tun by this command will use their own config files, so just few values +run by this command will use their own config files, so just few values are required for it to run. @@ -43,9 +42,5 @@ currency = EUR taler-merchant-generate-payments -c config/file.conf [-n ITERATIONS] -The -n option instructs the tools about how many iteration of all +The -n option instructs the tool about how many iterations of all the (internal) commands we want to execute. - -** Taler Merchant Dbinit ** - -TBD 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" |