From 796d0e5aa54ed99dd00fae26982a0e99f9d99f8e Mon Sep 17 00:00:00 2001 From: Marcello Stanisci Date: Wed, 15 Mar 2017 11:40:24 +0100 Subject: Porting 'nat'. --- src/testing/gnunet-testing.c | 40 +++++++++++++++++++++++++++++----------- src/testing/list-keys.c | 15 +++++---------- 2 files changed, 34 insertions(+), 21 deletions(-) (limited to 'src/testing') diff --git a/src/testing/gnunet-testing.c b/src/testing/gnunet-testing.c index 07f1560cb..686b38192 100644 --- a/src/testing/gnunet-testing.c +++ b/src/testing/gnunet-testing.c @@ -348,17 +348,35 @@ run_no_scheduler (void *cls, char *const *args, const char *cfgfile, int main (int argc, char *const *argv) { - static const struct GNUNET_GETOPT_CommandLineOption options[] = { - {'C', "cfg", NULL, gettext_noop ("create unique configuration files"), - GNUNET_NO, &GNUNET_GETOPT_set_one, &create_cfg}, - {'k', "key", "FILENAME", gettext_noop ("extract hostkey file from pre-computed hostkey list"), - GNUNET_YES, &GNUNET_GETOPT_set_string, &create_hostkey}, - {'n', "number", "NUMBER", gettext_noop ("number of unique configuration files to create, or number of the hostkey to extract"), - GNUNET_YES, &GNUNET_GETOPT_set_uint, &create_no}, - {'t', "template", "FILENAME", gettext_noop ("configuration template"), - GNUNET_YES, &GNUNET_GETOPT_set_string, &create_cfg_template}, - {'r', "run", "SERVICE", gettext_noop ("run the given service, wait on stdin for 'r' (restart) or 'q' (quit)"), - GNUNET_YES, &GNUNET_GETOPT_set_string, &run_service_name}, + struct GNUNET_GETOPT_CommandLineOption options[] = { + GNUNET_GETOPT_OPTION_SET_ONE ('C', + "cfg", + gettext_noop ("create unique configuration files"), + &create_cfg), + GNUNET_GETOPT_OPTION_STRING ('k', + "key", + "FILENAME", + gettext_noop ("extract hostkey file from pre-computed hostkey list"), + &create_hostkey), + + GNUNET_GETOPT_OPTION_SET_UINT ('n', + "number", + "NUMBER", + gettext_noop ("number of unique configuration files to create, or number of the hostkey to extract"), + &create_no), + + + GNUNET_GETOPT_OPTION_STRING ('t', + "template", + "FILENAME", + gettext_noop ("configuration template"), + &create_cfg_template), + + GNUNET_GETOPT_OPTION_STRING ('r', + "run", + "SERVICE", + gettext_noop ("run the given service, wait on stdin for 'r' (restart) or 'q' (quit)"), + &run_service_name), GNUNET_GETOPT_OPTION_END }; if (GNUNET_OK != GNUNET_STRINGS_get_utf8_args (argc, argv, &argc, &argv)) diff --git a/src/testing/list-keys.c b/src/testing/list-keys.c index 1fd46ebf2..cfb49460a 100644 --- a/src/testing/list-keys.c +++ b/src/testing/list-keys.c @@ -6,10 +6,6 @@ static unsigned int nkeys; static unsigned int nskip; static int result; - - - - /** * Main run function. * @@ -87,12 +83,11 @@ run (void *cls, char *const *args, const char *cfgfile, int main (int argc, char *argv[]) { struct GNUNET_GETOPT_CommandLineOption option[] = { - {'n', "num-keys", "COUNT", - gettext_noop ("list COUNT number of keys"), - GNUNET_YES, &GNUNET_GETOPT_set_uint, &nkeys}, - {'s', "skip", "COUNT", - gettext_noop ("skip COUNT number of keys in the beginning"), - GNUNET_YES, &GNUNET_GETOPT_set_uint, &nskip}, + GNUNET_GETOPT_OPTION_SET_UINT ('n', + "num-keys", + "COUNT", + gettext_noop ("list COUNT number of keys"), + &nkeys), GNUNET_GETOPT_OPTION_END }; int ret; -- cgit v1.2.3