int
main (int argc, char *const *argv)
{
- static const struct GNUNET_GETOPT_CommandLineOption options[] = {
- {'n', "num-peers", "COUNT",
- gettext_noop ("run the experiment with COUNT peers"),
- 1, &GNUNET_GETOPT_set_uint, &num_peers},
- {'H', "hosts", "HOSTFILE",
- gettext_noop ("specifies name of a file with the HOSTS the testbed should use"),
- 1, &GNUNET_GETOPT_set_string, &host_filename},
- {'t', "timeout", "DELAY",
- gettext_noop ("automatically terminate experiment after DELAY"),
- 1, &GNUNET_GETOPT_set_relative_time, &timeout},
+ struct GNUNET_GETOPT_CommandLineOption options[] = {
+
+ GNUNET_GETOPT_OPTION_SET_UINT ('n',
+ "num-peers",
+ "COUNT",
+ gettext_noop ("run the experiment with COUNT peers"),
+ &num_peers),
+
+ GNUNET_GETOPT_OPTION_STRING ('H',
+ "hosts",
+ "HOSTFILE",
+ gettext_noop ("specifies name of a file with the HOSTS the testbed should use"),
+ &host_filename),
+
+ GNUNET_GETOPT_OPTION_SET_RELATIVE_TIME ('t',
+ "timeout",
+ "DELAY",
+ gettext_noop ("automatically terminate experiment after DELAY"),
+ &timeout),
+
GNUNET_GETOPT_OPTION_END
};
if (GNUNET_OK != GNUNET_STRINGS_get_utf8_args (argc, argv, &argc, &argv))
/**
* Option -v given?
*/
-static int verbose;
+static unsigned int verbose;
/**
int
main (int argc, char *const *argv)
{
- static struct GNUNET_GETOPT_CommandLineOption options[] = {
- {'i', "list-indexed", NULL,
- gettext_noop ("print a list of all indexed files"), 0,
- &GNUNET_GETOPT_set_one, &list_indexed_files},
+ struct GNUNET_GETOPT_CommandLineOption options[] = {
+
+ GNUNET_GETOPT_OPTION_SET_ONE ('i',
+ "list-indexed",
+ gettext_noop ("print a list of all indexed files"),
+ &list_indexed_files),
+
GNUNET_GETOPT_OPTION_VERBOSE (&verbose),
GNUNET_GETOPT_OPTION_END
};
static unsigned int results;
-static int verbose;
+static unsigned int verbose;
static int local_only;
int
main (int argc, char *const *argv)
{
- static const struct GNUNET_GETOPT_CommandLineOption options[] = {
- {'a', "anonymity", "LEVEL",
- gettext_noop ("set the desired LEVEL of receiver-anonymity"),
- 1, &GNUNET_GETOPT_set_uint, &anonymity},
- {'n', "no-network", NULL,
- gettext_noop ("only search the local peer (no P2P network search)"),
- 0, &GNUNET_GETOPT_set_one, &local_only},
- {'o', "output", "PREFIX",
- gettext_noop ("write search results to file starting with PREFIX"),
- 1, &GNUNET_GETOPT_set_string, &output_filename},
- {'t', "timeout", "DELAY",
- gettext_noop ("automatically terminate search after DELAY"),
- 1, &GNUNET_GETOPT_set_relative_time, &timeout},
- {'V', "verbose", NULL,
- gettext_noop ("be verbose (print progress information)"),
- 0, &GNUNET_GETOPT_set_one, &verbose},
- {'N', "results", "VALUE",
- gettext_noop
- ("automatically terminate search after VALUE results are found"),
- 1, &GNUNET_GETOPT_set_uint, &results_limit},
+ struct GNUNET_GETOPT_CommandLineOption options[] = {
+
+ GNUNET_GETOPT_OPTION_SET_UINT ('a',
+ "anonymity",
+ "LEVEL",
+ gettext_noop ("set the desired LEVEL of receiver-anonymity"),
+ &anonymity),
+
+
+ GNUNET_GETOPT_OPTION_SET_ONE ('n',
+ "no-network",
+ gettext_noop ("only search the local peer (no P2P network search)"),
+ &local_only),
+
+ GNUNET_GETOPT_OPTION_STRING ('o',
+ "output",
+ "PREFIX",
+ gettext_noop ("write search results to file starting with PREFIX"),
+ &output_filename),
+
+ GNUNET_GETOPT_OPTION_SET_RELATIVE_TIME ('t',
+ "timeout",
+ "DELAY",
+ gettext_noop ("automatically terminate search after DELAY"),
+ &timeout),
+
+
+ GNUNET_GETOPT_OPTION_VERBOSE (&verbose),
+
+ GNUNET_GETOPT_OPTION_SET_UINT ('N',
+ "results",
+ "VALUE",
+ gettext_noop ("automatically terminate search "
+ "after VALUE results are found"),
+ &results_limit),
+
GNUNET_GETOPT_OPTION_END
};
static int ret;
-static int verbose;
+static unsigned int verbose;
static const struct GNUNET_CONFIGURATION_Handle *cfg;
int
main (int argc, char *const *argv)
{
- static const struct GNUNET_GETOPT_CommandLineOption options[] = {
- {'V', "verbose", NULL,
- gettext_noop ("be verbose (print progress information)"),
- 0, &GNUNET_GETOPT_set_one, &verbose},
+ struct GNUNET_GETOPT_CommandLineOption options[] = {
+
+ GNUNET_GETOPT_OPTION_VERBOSE (&verbose),
+
GNUNET_GETOPT_OPTION_END
};