From 1c4f90e7c538f1489ea17be3d2f655c2390d7ccf Mon Sep 17 00:00:00 2001 From: Marcello Stanisci Date: Thu, 16 Mar 2017 15:26:57 +0100 Subject: porting gnunet-publish + others.. --- src/fs/gnunet-download.c | 74 ++++++++++++++++++++++++++++++------------------ 1 file changed, 46 insertions(+), 28 deletions(-) (limited to 'src/fs/gnunet-download.c') diff --git a/src/fs/gnunet-download.c b/src/fs/gnunet-download.c index 6d9adb8ab..4d6f30587 100644 --- a/src/fs/gnunet-download.c +++ b/src/fs/gnunet-download.c @@ -30,7 +30,7 @@ static int ret; -static int verbose; +static unsigned int verbose; static int delete_incomplete; @@ -299,33 +299,51 @@ run (void *cls, char *const *args, const char *cfgfile, 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}, - {'D', "delete-incomplete", NULL, - gettext_noop ("delete incomplete downloads (when aborted with CTRL-C)"), - 0, &GNUNET_GETOPT_set_one, &delete_incomplete}, - {'n', "no-network", NULL, - gettext_noop ("only search the local peer (no P2P network search)"), - 0, &GNUNET_GETOPT_set_one, &local_only}, - {'o', "output", "FILENAME", - gettext_noop ("write the file to FILENAME"), - 1, &GNUNET_GETOPT_set_string, &filename}, - {'p', "parallelism", "DOWNLOADS", - gettext_noop - ("set the maximum number of parallel downloads that is allowed"), - 1, &GNUNET_GETOPT_set_uint, ¶llelism}, - {'r', "request-parallelism", "REQUESTS", - gettext_noop - ("set the maximum number of parallel requests for blocks that is allowed"), - 1, &GNUNET_GETOPT_set_uint, &request_parallelism}, - {'R', "recursive", NULL, - gettext_noop ("download a GNUnet directory recursively"), - 0, &GNUNET_GETOPT_set_one, &do_recursive}, - {'V', "verbose", NULL, - gettext_noop ("be verbose (print progress information)"), - 0, &GNUNET_GETOPT_increment_value, &verbose}, + 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 ('D', + "delete-incomplete", + gettext_noop ("delete incomplete downloads (when aborted with CTRL-C)"), + &delete_incomplete), + + 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", + "FILENAME", + gettext_noop ("write the file to FILENAME"), + &filename), + + GNUNET_GETOPT_OPTION_SET_UINT ('p', + "parallelism", + "DOWNLOADS", + gettext_noop ("set the maximum number of parallel downloads that is allowed"), + ¶llelism), + + GNUNET_GETOPT_OPTION_SET_UINT ('r', + "request-parallelism", + "REQUESTS", + gettext_noop ("set the maximum number of parallel requests for blocks that is allowed"), + &request_parallelism), + + GNUNET_GETOPT_OPTION_SET_ONE ('R', + "recursive", + gettext_noop ("download a GNUnet directory recursively"), + &do_recursive), + + GNUNET_GETOPT_OPTION_INCREMENT_VALUE ('V', + "verbose", + gettext_noop ("be verbose (print progress information)"), + &verbose), + GNUNET_GETOPT_OPTION_END }; -- cgit v1.2.3