aboutsummaryrefslogtreecommitdiff
path: root/src/dht/gnunet-dht-get.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/dht/gnunet-dht-get.c')
-rw-r--r--src/dht/gnunet-dht-get.c68
1 files changed, 40 insertions, 28 deletions
diff --git a/src/dht/gnunet-dht-get.c b/src/dht/gnunet-dht-get.c
index ce479dc3e..67f0ce76d 100644
--- a/src/dht/gnunet-dht-get.c
+++ b/src/dht/gnunet-dht-get.c
@@ -50,7 +50,7 @@ static struct GNUNET_TIME_Relative timeout_request = { 60000 };
50/** 50/**
51 * Be verbose 51 * Be verbose
52 */ 52 */
53static int verbose; 53static unsigned int verbose;
54 54
55/** 55/**
56 * Use DHT demultixplex_everywhere 56 * Use DHT demultixplex_everywhere
@@ -226,33 +226,6 @@ run (void *cls, char *const *args, const char *cfgfile,
226 226
227} 227}
228 228
229
230/**
231 * gnunet-dht-get command line options
232 */
233static struct GNUNET_GETOPT_CommandLineOption options[] = {
234 {'k', "key", "KEY",
235 gettext_noop ("the query key"),
236 1, &GNUNET_GETOPT_set_string, &query_key},
237 {'r', "replication", "LEVEL",
238 gettext_noop ("how many parallel requests (replicas) to create"),
239 1, &GNUNET_GETOPT_set_uint, &replication},
240 {'t', "type", "TYPE",
241 gettext_noop ("the type of data to look for"),
242 1, &GNUNET_GETOPT_set_uint, &query_type},
243 {'T', "timeout", "TIMEOUT",
244 gettext_noop ("how long to execute this query before giving up?"),
245 1, &GNUNET_GETOPT_set_relative_time, &timeout_request},
246 {'x', "demultiplex", NULL,
247 gettext_noop ("use DHT's demultiplex everywhere option"),
248 0, &GNUNET_GETOPT_set_one, &demultixplex_everywhere},
249 {'V', "verbose", NULL,
250 gettext_noop ("be verbose (print progress information)"),
251 0, &GNUNET_GETOPT_set_one, &verbose},
252 GNUNET_GETOPT_OPTION_END
253};
254
255
256/** 229/**
257 * Entry point for gnunet-dht-get 230 * Entry point for gnunet-dht-get
258 * 231 *
@@ -263,6 +236,45 @@ static struct GNUNET_GETOPT_CommandLineOption options[] = {
263int 236int
264main (int argc, char *const *argv) 237main (int argc, char *const *argv)
265{ 238{
239
240 struct GNUNET_GETOPT_CommandLineOption options[] = {
241
242 GNUNET_GETOPT_OPTION_STRING ('k',
243 "key",
244 "KEY",
245 gettext_noop ("the query key"),
246 &query_key),
247
248 GNUNET_GETOPT_OPTION_SET_UINT ('r',
249 "replication",
250 "LEVEL",
251 gettext_noop ("how many parallel requests (replicas) to create"),
252 &replication),
253
254
255 GNUNET_GETOPT_OPTION_SET_UINT ('t',
256 "type",
257 "TYPE",
258 gettext_noop ("the type of data to look for"),
259 &query_type),
260
261 GNUNET_GETOPT_OPTION_SET_RELATIVE_TIME ('T',
262 "timeout",
263 "TIMEOUT",
264 gettext_noop ("how long to execute this query before giving up?"),
265 &timeout_request),
266
267 GNUNET_GETOPT_OPTION_SET_ONE ('x',
268 "demultiplex",
269 gettext_noop ("use DHT's demultiplex everywhere option"),
270 &demultixplex_everywhere),
271
272 GNUNET_GETOPT_OPTION_VERBOSE (&verbose),
273 GNUNET_GETOPT_OPTION_END
274 };
275
276
277
266 if (GNUNET_OK != GNUNET_STRINGS_get_utf8_args (argc, argv, &argc, &argv)) 278 if (GNUNET_OK != GNUNET_STRINGS_get_utf8_args (argc, argv, &argc, &argv))
267 return 2; 279 return 2;
268 return (GNUNET_OK == 280 return (GNUNET_OK ==