diff options
author | Marcello Stanisci <marcello.stanisci@inria.fr> | 2017-03-15 15:28:41 +0100 |
---|---|---|
committer | Marcello Stanisci <marcello.stanisci@inria.fr> | 2017-03-15 15:28:41 +0100 |
commit | 5d6ed5fbda01a324d8d9b800928339d4a90343c3 (patch) | |
tree | b52f65dfc01e42f989df7aa2569ae69695fd9a54 /src/transport/gnunet-transport.c | |
parent | 294393abdca9f482321696e9aaec64b1a0488607 (diff) | |
download | gnunet-5d6ed5fbda01a324d8d9b800928339d4a90343c3.tar.gz gnunet-5d6ed5fbda01a324d8d9b800928339d4a90343c3.zip |
Still porting to new getopt API.
Diffstat (limited to 'src/transport/gnunet-transport.c')
-rw-r--r-- | src/transport/gnunet-transport.c | 76 |
1 files changed, 44 insertions, 32 deletions
diff --git a/src/transport/gnunet-transport.c b/src/transport/gnunet-transport.c index fcfc94ac8..c0442950d 100644 --- a/src/transport/gnunet-transport.c +++ b/src/transport/gnunet-transport.c | |||
@@ -295,7 +295,7 @@ static struct GNUNET_SCHEDULER_Task *op_timeout; | |||
295 | /** | 295 | /** |
296 | * Selected level of verbosity. | 296 | * Selected level of verbosity. |
297 | */ | 297 | */ |
298 | static int verbosity; | 298 | static unsigned int verbosity; |
299 | 299 | ||
300 | /** | 300 | /** |
301 | * Resolver process handle. | 301 | * Resolver process handle. |
@@ -1439,37 +1439,49 @@ main (int argc, | |||
1439 | char * const *argv) | 1439 | char * const *argv) |
1440 | { | 1440 | { |
1441 | int res; | 1441 | int res; |
1442 | static const struct GNUNET_GETOPT_CommandLineOption options[] = { | 1442 | struct GNUNET_GETOPT_CommandLineOption options[] = { |
1443 | { 'a', "all", NULL, | 1443 | GNUNET_GETOPT_OPTION_SET_ONE ('a', |
1444 | gettext_noop ("print information for all peers (instead of only connected peers)"), | 1444 | "all", |
1445 | 0, &GNUNET_GETOPT_set_one, &iterate_all }, | 1445 | gettext_noop ("print information for all peers (instead of only connected peers)"), |
1446 | { 'b', "benchmark", NULL, | 1446 | &iterate_all), |
1447 | gettext_noop ("measure how fast we are receiving data from all peers (until CTRL-C)"), | 1447 | GNUNET_GETOPT_OPTION_SET_ONE ('b', |
1448 | 0, &GNUNET_GETOPT_set_one, &benchmark_receive }, | 1448 | "benchmark", |
1449 | { 'D', "disconnect", | 1449 | gettext_noop ("measure how fast we are receiving data from all peers (until CTRL-C)"), |
1450 | NULL, gettext_noop ("disconnect from a peer"), 0, | 1450 | &benchmark_receive), |
1451 | &GNUNET_GETOPT_set_one, &do_disconnect }, | 1451 | GNUNET_GETOPT_OPTION_SET_ONE ('D', |
1452 | { 'i', "information", NULL, | 1452 | "disconnect", |
1453 | gettext_noop ("provide information about all current connections (once)"), | 1453 | gettext_noop ("disconnect from a peer"), |
1454 | 0, &GNUNET_GETOPT_set_one, &iterate_connections }, | 1454 | &do_disconnect), |
1455 | { 'm', "monitor", NULL, | 1455 | GNUNET_GETOPT_OPTION_SET_ONE ('i', |
1456 | gettext_noop ("provide information about all current connections (continuously)"), | 1456 | "information", |
1457 | 0, &GNUNET_GETOPT_set_one, &monitor_connections }, | 1457 | gettext_noop ("provide information about all current connections (once)"), |
1458 | { 'e', "events", NULL, | 1458 | &iterate_connections), |
1459 | gettext_noop ("provide information about all connects and disconnect events (continuously)"), | 1459 | GNUNET_GETOPT_OPTION_SET_ONE ('m', |
1460 | 0, &GNUNET_GETOPT_set_one, &monitor_connects }, | 1460 | "monitor", |
1461 | { 'n', "numeric", | 1461 | gettext_noop ("provide information about all current connections (continuously)"), |
1462 | NULL, gettext_noop ("do not resolve hostnames"), 0, | 1462 | &monitor_connections), |
1463 | &GNUNET_GETOPT_set_one, &numeric }, | 1463 | GNUNET_GETOPT_OPTION_SET_ONE ('e', |
1464 | { 'p', "peer", "PEER", | 1464 | "events", |
1465 | gettext_noop ("peer identity"), 1, &GNUNET_GETOPT_set_string, | 1465 | gettext_noop ("provide information about all connects and disconnect events (continuously)"), |
1466 | &cpid }, | 1466 | &monitor_connects), |
1467 | { 'P', "plugins", NULL, | 1467 | GNUNET_GETOPT_OPTION_SET_ONE ('n', |
1468 | gettext_noop ("monitor plugin sessions"), 0, &GNUNET_GETOPT_set_one, | 1468 | "numeric", |
1469 | &monitor_plugins }, | 1469 | gettext_noop ("do not resolve hostnames"), |
1470 | { 's', "send", NULL, gettext_noop | 1470 | &numeric), |
1471 | ("send data for benchmarking to the other peer (until CTRL-C)"), 0, | 1471 | GNUNET_GETOPT_OPTION_STRING ('p', |
1472 | &GNUNET_GETOPT_set_one, &benchmark_send }, | 1472 | "peer", |
1473 | "PEER", | ||
1474 | gettext_noop ("peer identity"), | ||
1475 | &cpid), | ||
1476 | GNUNET_GETOPT_OPTION_SET_ONE ('P', | ||
1477 | "plugins", | ||
1478 | gettext_noop ("monitor plugin sessions"), | ||
1479 | &monitor_plugins), | ||
1480 | GNUNET_GETOPT_OPTION_SET_ONE ('s', | ||
1481 | "send", | ||
1482 | gettext_noop | ||
1483 | ("send data for benchmarking to the other peer (until CTRL-C)"), | ||
1484 | &benchmark_send), | ||
1473 | GNUNET_GETOPT_OPTION_VERBOSE (&verbosity), | 1485 | GNUNET_GETOPT_OPTION_VERBOSE (&verbosity), |
1474 | GNUNET_GETOPT_OPTION_END | 1486 | GNUNET_GETOPT_OPTION_END |
1475 | }; | 1487 | }; |