aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMarcello Stanisci <marcello.stanisci@inria.fr>2017-03-17 14:24:13 +0100
committerMarcello Stanisci <marcello.stanisci@inria.fr>2017-03-17 14:26:07 +0100
commit421ad27103356b4a21636c76618bf374b2e10bc9 (patch)
tree27ffaeaa91219b4666de0a182ceefa5b46f8092f
parent5b085881ab278a85c3ef3a1d91c58a5724a4e430 (diff)
downloadgnunet-421ad27103356b4a21636c76618bf374b2e10bc9.tar.gz
gnunet-421ad27103356b4a21636c76618bf374b2e10bc9.zip
Porting leftovers to new getopt API.
-rw-r--r--src/ats/gnunet-ats-solver-eval.c45
-rw-r--r--src/ats/perf_ats_solver.c57
-rw-r--r--src/cadet/test_cadet.c17
-rw-r--r--src/conversation/gnunet-conversation.c21
-rw-r--r--src/dv/gnunet-dv.c10
-rw-r--r--src/regex/gnunet-regex-simulation-profiler.c21
6 files changed, 107 insertions, 64 deletions
diff --git a/src/ats/gnunet-ats-solver-eval.c b/src/ats/gnunet-ats-solver-eval.c
index e2e68562c..597285f5e 100644
--- a/src/ats/gnunet-ats-solver-eval.c
+++ b/src/ats/gnunet-ats-solver-eval.c
@@ -3289,24 +3289,33 @@ main (int argc, char *argv[])
3289 3289
3290 static struct GNUNET_GETOPT_CommandLineOption options[] = 3290 static struct GNUNET_GETOPT_CommandLineOption options[] =
3291 { 3291 {
3292 { 's', "solver", NULL, 3292 GNUNET_GETOPT_OPTION_STRING ('s',
3293 gettext_noop ("solver to use"), 3293 "solver",
3294 1, &GNUNET_GETOPT_set_string, &opt_solver}, 3294 gettext_noop ("solver to use"),
3295 { 'e', "experiment", NULL, 3295 &opt_solver),
3296 gettext_noop ("experiment to use"), 3296
3297 1, &GNUNET_GETOPT_set_string, &opt_exp_file}, 3297 GNUNET_GETOPT_OPTION_STRING ('e',
3298 { 'V', "verbose", NULL, 3298 "experiment"
3299 gettext_noop ("be verbose"), 3299 gettext_noop ("experiment to use"),
3300 0, &GNUNET_GETOPT_set_one, &opt_verbose}, 3300 &opt_exp_file),
3301 { 'p', "print", NULL, 3301
3302 gettext_noop ("print logging"), 3302 GNUNET_GETOPT_OPTION_VERBOSE (&opt_verbose),
3303 0, &GNUNET_GETOPT_set_one, &opt_print}, 3303
3304 { 'f', "file", NULL, 3304 GNUNET_GETOPT_OPTION_SET_ONE ('p',
3305 gettext_noop ("save logging to disk"), 3305 "print",
3306 0, &GNUNET_GETOPT_set_one, &opt_save}, 3306 gettext_noop ("print logging"),
3307 { 'd', "dn", NULL, 3307 &opt_print),
3308 gettext_noop ("disable normalization"), 3308
3309 0, &GNUNET_GETOPT_set_one, &opt_disable_normalization}, 3309 GNUNET_GETOPT_OPTION_SET_ONE ('f',
3310 "file",
3311 gettext_noop ("save logging to disk"),
3312 &opt_save),
3313
3314 GNUNET_GETOPT_OPTION_SET_ONE ('d',
3315 "dn",
3316 gettext_noop ("disable normalization"),
3317 &opt_disable_normalization),
3318
3310 GNUNET_GETOPT_OPTION_END 3319 GNUNET_GETOPT_OPTION_END
3311 }; 3320 };
3312 3321
diff --git a/src/ats/perf_ats_solver.c b/src/ats/perf_ats_solver.c
index f05668e9b..855899b36 100644
--- a/src/ats/perf_ats_solver.c
+++ b/src/ats/perf_ats_solver.c
@@ -1404,27 +1404,42 @@ main (int argc, char *argv[])
1404 ph.total_iterations = 1; 1404 ph.total_iterations = 1;
1405 1405
1406 static struct GNUNET_GETOPT_CommandLineOption options[] = { 1406 static struct GNUNET_GETOPT_CommandLineOption options[] = {
1407 { 'a', "addresses", NULL, 1407
1408 gettext_noop ("addresses to use"), 1408 GNUNET_GETOPT_OPTION_SET_UINT ('a',
1409 1, &GNUNET_GETOPT_set_uint, &ph.N_address }, 1409 "addresses",
1410 { 's', "start", NULL, 1410 gettext_noop ("addresses to use"),
1411 gettext_noop ("start with peer"), 1411 &ph.N_address),
1412 1, &GNUNET_GETOPT_set_uint, &ph.N_peers_start }, 1412
1413 { 'e', "end", NULL, 1413 GNUNET_GETOPT_OPTION_SET_UINT ('s',
1414 gettext_noop ("end with peer"), 1414 "start",
1415 1, &GNUNET_GETOPT_set_uint, &ph.N_peers_end }, 1415 gettext_noop ("start with peer"),
1416 { 'i', "iterations", NULL, 1416 &ph.N_peers_start),
1417 gettext_noop ("number of iterations used for averaging (default: 1)"), 1417
1418 1, &GNUNET_GETOPT_set_uint, &ph.total_iterations }, 1418 GNUNET_GETOPT_OPTION_SET_UINT ('e',
1419 { 'p', "percentage", NULL, 1419 "end",
1420 gettext_noop ("update a fix percentage of addresses"), 1420 gettext_noop ("end with peer"),
1421 1, &GNUNET_GETOPT_set_uint, &ph.opt_update_percent }, 1421 &ph.N_peers_end),
1422 { 'd', "data", NULL, 1422
1423 gettext_noop ("create data file"), 1423 GNUNET_GETOPT_OPTION_SET_UINT ('i',
1424 0, &GNUNET_GETOPT_set_one, &ph.create_datafile}, 1424 "iterations",
1425 { 'u', "update", NULL, 1425 gettext_noop ("number of iterations used for averaging (default: 1)"),
1426 gettext_noop ("measure updates"), 1426 &ph.total_iterations),
1427 0, &GNUNET_GETOPT_set_one, &ph.measure_updates}, 1427
1428 GNUNET_GETOPT_OPTION_SET_UINT ('p',
1429 "percentage",
1430 gettext_noop ("update a fix percentage of addresses"),
1431 &ph.opt_update_percent),
1432
1433 GNUNET_GETOPT_OPTION_SET_ONE ('d',
1434 "data",
1435 gettext_noop ("create data file"),
1436 &ph.create_datafile),
1437
1438 GNUNET_GETOPT_OPTION_SET_ONE ('u',
1439 "update",
1440 gettext_noop ("measure updates"),
1441 &ph.measure_updates),
1442
1428 GNUNET_GETOPT_OPTION_END 1443 GNUNET_GETOPT_OPTION_END
1429 }; 1444 };
1430 1445
diff --git a/src/cadet/test_cadet.c b/src/cadet/test_cadet.c
index 3586b26ac..a7304c3ee 100644
--- a/src/cadet/test_cadet.c
+++ b/src/cadet/test_cadet.c
@@ -962,12 +962,17 @@ main (int argc, char *argv[])
962 char port_id[] = "test port"; 962 char port_id[] = "test port";
963 963
964 static const struct GNUNET_GETOPT_CommandLineOption options[] = { 964 static const struct GNUNET_GETOPT_CommandLineOption options[] = {
965 {'t', "time", "short_time", 965 GNUNET_GETOPT_OPTION_SET_RELATIVE_TIME ('t',
966 gettext_noop ("set short timeout"), 966 "time",
967 GNUNET_YES, &GNUNET_GETOPT_set_relative_time, &short_time}, 967 "short_time",
968 {'m', "messages", "NUM_MESSAGES", 968 gettext_noop ("set short timeout"),
969 gettext_noop ("set number of messages to send"), 969 &short_time),
970 GNUNET_YES, &GNUNET_GETOPT_set_uint, &total_packets}, 970
971 GNUNET_GETOPT_OPTION_SET_UINT ('m',
972 "messages",
973 "NUM_MESSAGES",
974 gettext_noop ("set number of messages to send"),
975 &total_packets),
971 976
972 GNUNET_GETOPT_OPTION_END 977 GNUNET_GETOPT_OPTION_END
973 }; 978 };
diff --git a/src/conversation/gnunet-conversation.c b/src/conversation/gnunet-conversation.c
index 925db4665..c5275c0de 100644
--- a/src/conversation/gnunet-conversation.c
+++ b/src/conversation/gnunet-conversation.c
@@ -1265,13 +1265,20 @@ run (void *cls,
1265int 1265int
1266main (int argc, char *const *argv) 1266main (int argc, char *const *argv)
1267{ 1267{
1268 static const struct GNUNET_GETOPT_CommandLineOption options[] = { 1268 struct GNUNET_GETOPT_CommandLineOption options[] = {
1269 {'e', "ego", "NAME", 1269
1270 gettext_noop ("sets the NAME of the ego to use for the phone (and name resolution)"), 1270 GNUNET_GETOPT_OPTION_STRING ('e',
1271 1, &GNUNET_GETOPT_set_string, &ego_name}, 1271 "ego",
1272 {'p', "phone", "LINE", 1272 "NAME",
1273 gettext_noop ("sets the LINE to use for the phone"), 1273 gettext_noop ("sets the NAME of the ego to use for the phone (and name resolution)"),
1274 1, &GNUNET_GETOPT_set_string, &line}, 1274 &ego_name),
1275
1276 GNUNET_GETOPT_OPTION_STRING ('p',
1277 "phone",
1278 "LINE",
1279 gettext_noop ("sets the LINE to use for the phone"),
1280 &line),
1281
1275 GNUNET_GETOPT_OPTION_END 1282 GNUNET_GETOPT_OPTION_END
1276 }; 1283 };
1277 int ret; 1284 int ret;
diff --git a/src/dv/gnunet-dv.c b/src/dv/gnunet-dv.c
index d0917d363..cb40bb6d2 100644
--- a/src/dv/gnunet-dv.c
+++ b/src/dv/gnunet-dv.c
@@ -34,7 +34,7 @@ static struct GNUNET_DV_ServiceHandle *sh;
34/** 34/**
35 * Was verbose specified? 35 * Was verbose specified?
36 */ 36 */
37static int verbose; 37static unsigned int verbose;
38 38
39 39
40/** 40/**
@@ -161,10 +161,10 @@ main (int argc, char *const *argv)
161{ 161{
162 int res; 162 int res;
163 163
164 static const struct GNUNET_GETOPT_CommandLineOption options[] = { 164 struct GNUNET_GETOPT_CommandLineOption options[] = {
165 {'V', "verbose", NULL, 165
166 gettext_noop ("verbose output"), 166 GNUNET_GETOPT_OPTION_VERBOSE (&verbose),
167 0, &GNUNET_GETOPT_set_one, &verbose}, 167
168 GNUNET_GETOPT_OPTION_END 168 GNUNET_GETOPT_OPTION_END
169 }; 169 };
170 170
diff --git a/src/regex/gnunet-regex-simulation-profiler.c b/src/regex/gnunet-regex-simulation-profiler.c
index 025a70316..422e45565 100644
--- a/src/regex/gnunet-regex-simulation-profiler.c
+++ b/src/regex/gnunet-regex-simulation-profiler.c
@@ -691,13 +691,20 @@ run (void *cls,
691int 691int
692main (int argc, char *const *argv) 692main (int argc, char *const *argv)
693{ 693{
694 static const struct GNUNET_GETOPT_CommandLineOption options[] = { 694 struct GNUNET_GETOPT_CommandLineOption options[] = {
695 {'t', "table", "TABLENAME", 695
696 gettext_noop ("name of the table to write DFAs"), 696 GNUNET_GETOPT_OPTION_STRING ('t',
697 1, &GNUNET_GETOPT_set_string, &table_name}, 697 "table",
698 {'p', "max-path-compression", "MAX_PATH_COMPRESSION", 698 "TABLENAME",
699 gettext_noop ("maximum path compression length"), 699 gettext_noop ("name of the table to write DFAs"),
700 1, &GNUNET_GETOPT_set_uint, &max_path_compression}, 700 &table_name),
701
702 GNUNET_GETOPT_OPTION_SET_UINT ('p',
703 "max-path-compression",
704 "MAX_PATH_COMPRESSION",
705 gettext_noop ("maximum path compression length"),
706 &max_path_compression),
707
701 GNUNET_GETOPT_OPTION_END 708 GNUNET_GETOPT_OPTION_END
702 }; 709 };
703 int ret; 710 int ret;