summaryrefslogtreecommitdiff
path: root/src/ats-tool/gnunet-ats.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/ats-tool/gnunet-ats.c')
-rw-r--r--src/ats-tool/gnunet-ats.c84
1 files changed, 56 insertions, 28 deletions
diff --git a/src/ats-tool/gnunet-ats.c b/src/ats-tool/gnunet-ats.c
index 5fc1d6e92..f645ba56d 100644
--- a/src/ats-tool/gnunet-ats.c
+++ b/src/ats-tool/gnunet-ats.c
@@ -944,34 +944,62 @@ main (int argc,
stat_receive_done = GNUNET_NO;
opt_type_str = NULL;
- static const struct GNUNET_GETOPT_CommandLineOption options[] = {
- { 'u', "used", NULL,
- gettext_noop ("get list of active addresses currently used"), 0,
- &GNUNET_GETOPT_set_one, &opt_list_used },
- { 'a', "all", NULL, gettext_noop ("get list of all active addresses"), 0,
- &GNUNET_GETOPT_set_one, &opt_list_all },
- { 'C', "connect", "PEER",
- gettext_noop ("connect to PEER"), 1,
- &GNUNET_GETOPT_set_string, &cpid_str },
- { 'n', "numeric", NULL,
- gettext_noop ("do not resolve IP addresses to hostnames"), 0,
- &GNUNET_GETOPT_set_one, &opt_resolve_addresses_numeric },
- { 'm', "monitor", NULL, gettext_noop ("monitor mode"), 0,
- &GNUNET_GETOPT_set_one, &opt_monitor },
- { 'p', "preference", NULL, gettext_noop ("set preference for the given peer"),
- 0, &GNUNET_GETOPT_set_one, &opt_set_pref },
- { 'q', "quotas", NULL, gettext_noop ("print all configured quotas"), 0,
- &GNUNET_GETOPT_set_one, &opt_print_quotas },
- { 'i', "id", "TYPE", gettext_noop ("peer id"), 1, &GNUNET_GETOPT_set_string,
- &opt_pid_str },
- { 't', "type", "TYPE",
- gettext_noop ("preference type to set: latency | bandwidth"), 1,
- &GNUNET_GETOPT_set_string, &opt_type_str },
- { 'k', "value", "VALUE", gettext_noop ("preference value"), 1,
- &GNUNET_GETOPT_set_uint, &opt_pref_value },
- { 'V', "verbose", NULL,
- gettext_noop ("verbose output (include ATS address properties)"), 0,
- &GNUNET_GETOPT_set_one, &opt_verbose },
+ struct GNUNET_GETOPT_CommandLineOption options[] = {
+ GNUNET_GETOPT_OPTION_SET_ONE ('u',
+ "used",
+ gettext_noop ("get list of active addresses currently used"),
+ &opt_list_used),
+ GNUNET_GETOPT_OPTION_SET_ONE ('a',
+ "all",
+ gettext_noop ("get list of all active addresses"),
+ &opt_list_all),
+
+ GNUNET_GETOPT_OPTION_STRING ('C',
+ "connect",
+ NULL,
+ gettext_noop ("connect to PEER"),
+ &cpid_str),
+ GNUNET_GETOPT_OPTION_SET_ONE ('n',
+ "numeric",
+ gettext_noop ("do not resolve IP addresses to hostnames"),
+ &opt_resolve_addresses_numeric),
+
+ GNUNET_GETOPT_OPTION_SET_ONE ('m',
+ "monitor",
+ gettext_noop ("monitor mode"),
+ &opt_monitor),
+
+ GNUNET_GETOPT_OPTION_SET_ONE ('p',
+ "preference",
+ gettext_noop ("set preference for the given peer"),
+ &opt_set_pref),
+
+ GNUNET_GETOPT_OPTION_SET_ONE ('q',
+ "quotas",
+ gettext_noop ("print all configured quotas"),
+ &opt_print_quotas),
+ GNUNET_GETOPT_OPTION_STRING ('i',
+ "id",
+ "TYPE",
+ gettext_noop ("peer id"),
+ &opt_pid_str),
+
+ GNUNET_GETOPT_OPTION_STRING ('t',
+ "type",
+ "TYPE",
+ gettext_noop ("preference type to set: latency | bandwidth"),
+ &opt_type_str),
+
+ GNUNET_GETOPT_OPTION_SET_UINT ('k',
+ "value",
+ "VALUE",
+ gettext_noop ("preference value"),
+ &opt_pref_value),
+
+ GNUNET_GETOPT_OPTION_SET_ONE ('V',
+ "verbose",
+ gettext_noop ("verbose output (include ATS address properties)"),
+ &opt_verbose),
GNUNET_GETOPT_OPTION_END
};