summaryrefslogtreecommitdiff
path: root/src/exchange
diff options
context:
space:
mode:
authorChristian Grothoff <christian@grothoff.org>2017-03-15 12:01:06 +0100
committerChristian Grothoff <christian@grothoff.org>2017-03-15 12:01:06 +0100
commitae3e850c946947cead6b9330f7c8e9764bd5f934 (patch)
treec031aeb264149454869f1ace7bf8db0a04d3002b /src/exchange
parent296f919ce4dcd9123c402d52d18afae7e353b11a (diff)
downloadexchange-ae3e850c946947cead6b9330f7c8e9764bd5f934.tar.gz
exchange-ae3e850c946947cead6b9330f7c8e9764bd5f934.tar.bz2
exchange-ae3e850c946947cead6b9330f7c8e9764bd5f934.zip
update getopt config parsing style to match 'getopt' GNUnet branch API change
Diffstat (limited to 'src/exchange')
-rw-r--r--src/exchange/taler-exchange-aggregator.c9
-rw-r--r--src/exchange/taler-exchange-httpd.c37
2 files changed, 27 insertions, 19 deletions
diff --git a/src/exchange/taler-exchange-aggregator.c b/src/exchange/taler-exchange-aggregator.c
index cbf3fb5d3..ae4ee24fd 100644
--- a/src/exchange/taler-exchange-aggregator.c
+++ b/src/exchange/taler-exchange-aggregator.c
@@ -1198,10 +1198,11 @@ int
main (int argc,
char *const *argv)
{
- static const struct GNUNET_GETOPT_CommandLineOption options[] = {
- {'t', "test", NULL,
- "run in test mode and exit when idle", 0,
- &GNUNET_GETOPT_set_one, &test_mode},
+ struct GNUNET_GETOPT_CommandLineOption options[] = {
+ GNUNET_GETOPT_OPTION_SET_ONE ('t',
+ "test",
+ "run in test mode and exit when idle",
+ &test_mode),
GNUNET_GETOPT_OPTION_VERSION (VERSION "-" VCS_VERSION),
GNUNET_GETOPT_OPTION_END
};
diff --git a/src/exchange/taler-exchange-httpd.c b/src/exchange/taler-exchange-httpd.c
index fa000d06b..6b430d734 100644
--- a/src/exchange/taler-exchange-httpd.c
+++ b/src/exchange/taler-exchange-httpd.c
@@ -934,23 +934,30 @@ main (int argc,
char *loglev = NULL;
char *logfile = NULL;
const struct GNUNET_GETOPT_CommandLineOption options[] = {
- {'C', "connection-close", NULL,
- "force HTTP connections to be closed after each request", 0,
- &GNUNET_GETOPT_set_one, &TEH_exchange_connection_close},
+ GNUNET_GETOPT_OPTION_SET_ONE ('C',
+ "connection-close",
+ "force HTTP connections to be closed after each request",
+ &TEH_exchange_connection_close),
GNUNET_GETOPT_OPTION_CFG_FILE (&cfgfile),
- {'D', "disable-admin", NULL,
- "do not run the /admin-HTTP server", 0,
- &GNUNET_GETOPT_set_one, &no_admin},
- {'i', "init-db", NULL,
- "create database tables and indicies if necessary", 0,
- &GNUNET_GETOPT_set_one, &init_db},
- {'t', "timeout", "SECONDS",
- "after how long do connections timeout by default (in seconds)", 1,
- &GNUNET_GETOPT_set_uint, &connection_timeout},
+ GNUNET_GETOPT_OPTION_SET_ONE ('D',
+ "disable-admin",
+ "do not run the /admin-HTTP server",
+ &no_admin),
+ GNUNET_GETOPT_OPTION_SET_ONE ('i',
+ "init-db",
+ "create database tables and indicies if necessary",
+ &init_db),
+ GNUNET_GETOPT_OPTION_SET_UINT ('t',
+ "timeout",
+ "SECONDS",
+ "after how long do connections timeout by default (in seconds)",
+ &connection_timeout),
#if HAVE_DEVELOPER
- {'f', "file-input", "FILENAME",
- "run in test-mode using FILENAME as the HTTP request to process", 1,
- &GNUNET_GETOPT_set_filename, &input_filename},
+ GNUNET_GETOPT_OPTION_FILENAME ('f',
+ "file-input",
+ "FILENAME",
+ "run in test-mode using FILENAME as the HTTP request to process",
+ &input_filename),
#endif
GNUNET_GETOPT_OPTION_HELP ("HTTP server providing a RESTful API to access a Taler exchange"),
GNUNET_GETOPT_OPTION_LOGLEVEL (&loglev),