aboutsummaryrefslogtreecommitdiff
path: root/src/ats
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 /src/ats
parent5b085881ab278a85c3ef3a1d91c58a5724a4e430 (diff)
downloadgnunet-421ad27103356b4a21636c76618bf374b2e10bc9.tar.gz
gnunet-421ad27103356b4a21636c76618bf374b2e10bc9.zip
Porting leftovers to new getopt API.
Diffstat (limited to 'src/ats')
-rw-r--r--src/ats/gnunet-ats-solver-eval.c45
-rw-r--r--src/ats/perf_ats_solver.c57
2 files changed, 63 insertions, 39 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