summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMarcello Stanisci <stanisci.m@gmail.com>2019-03-05 17:41:57 +0100
committerMarcello Stanisci <stanisci.m@gmail.com>2019-03-05 17:41:57 +0100
commit5532fdfdd1bc986afc5d52e9ba909b826afbb86e (patch)
tree3a80a42aec33d693bd205d73b393d0fa070c46bd
parent60ff8720245d90ade29e0c8637404bab82cb0c1b (diff)
downloadmerchant-5532fdfdd1bc986afc5d52e9ba909b826afbb86e.tar.gz
merchant-5532fdfdd1bc986afc5d52e9ba909b826afbb86e.tar.bz2
merchant-5532fdfdd1bc986afc5d52e9ba909b826afbb86e.zip
Benchmark.v0.5.1
Taking the currency from CLI arguments as well, as there was no need to parse the config just to fetch this value.
-rw-r--r--src/merchant-tools/taler-merchant-benchmark.c35
1 files changed, 13 insertions, 22 deletions
diff --git a/src/merchant-tools/taler-merchant-benchmark.c b/src/merchant-tools/taler-merchant-benchmark.c
index 0d5cf83a..1a870de6 100644
--- a/src/merchant-tools/taler-merchant-benchmark.c
+++ b/src/merchant-tools/taler-merchant-benchmark.c
@@ -46,7 +46,7 @@ enum PaymentGeneratorError {
MISSING_BANK_URL,
FAILED_TO_LAUNCH_BANK,
BAD_CLI_ARG,
- BAD_CONFIG_FILE
+ MISSING_CURRENCY
};
/* Hard-coded params. Note, the bank is expected to
@@ -520,7 +520,6 @@ run (void *cls,
fprintf (stderr,
"None of 'ordinary' or 'corner'"
" subcommands were given\n");
-
result = 1;
}
@@ -614,6 +613,13 @@ main (int argc,
&merchant_url),
GNUNET_GETOPT_option_string
+ ('k',
+ "currency",
+ "K",
+ "Used currency, mandatory",
+ &currency),
+
+ GNUNET_GETOPT_option_string
('i',
"alt-instance",
"AI",
@@ -729,7 +735,8 @@ main (int argc,
if (GNUNET_YES == root_help)
{
- fprintf (stdout, root_help_str);
+ fprintf (stdout,
+ root_help_str);
return 0;
}
@@ -760,27 +767,11 @@ main (int argc,
if (NULL == cfg_filename)
cfg_filename = (char *) default_config_file;
- cfg = GNUNET_CONFIGURATION_create ();
- if (GNUNET_OK != GNUNET_CONFIGURATION_load
- (cfg,
- cfg_filename))
- {
- TALER_LOG_ERROR ("Could not parse configuration\n");
- return BAD_CONFIG_FILE;
- }
- if (GNUNET_OK != GNUNET_CONFIGURATION_get_value_string
- (cfg,
- "taler",
- "currency",
- &currency))
+ if (NULL == currency)
{
- GNUNET_log_config_missing (GNUNET_ERROR_TYPE_ERROR,
- "taler",
- "currency");
- GNUNET_CONFIGURATION_destroy (cfg);
- return BAD_CONFIG_FILE;
+ TALER_LOG_ERROR ("Option -k is mandatory!\n");
+ return MISSING_CURRENCY;
}
- GNUNET_CONFIGURATION_destroy (cfg);
if (NULL == merchant_url)
{