aboutsummaryrefslogtreecommitdiff
path: root/src/dht/gnunet-dht-monitor.c
diff options
context:
space:
mode:
authorMarcello Stanisci <marcello.stanisci@inria.fr>2017-03-15 16:21:06 +0100
committerMarcello Stanisci <marcello.stanisci@inria.fr>2017-03-15 16:21:06 +0100
commite6b3fec9e4a573e1f0c594a3c2f345357c0c12b8 (patch)
tree2fecdbebccc0970ff483ed28ea327f056f87423b /src/dht/gnunet-dht-monitor.c
parent5d6ed5fbda01a324d8d9b800928339d4a90343c3 (diff)
downloadgnunet-e6b3fec9e4a573e1f0c594a3c2f345357c0c12b8.tar.gz
gnunet-e6b3fec9e4a573e1f0c594a3c2f345357c0c12b8.zip
getopt API porting.
Diffstat (limited to 'src/dht/gnunet-dht-monitor.c')
-rw-r--r--src/dht/gnunet-dht-monitor.c50
1 files changed, 29 insertions, 21 deletions
diff --git a/src/dht/gnunet-dht-monitor.c b/src/dht/gnunet-dht-monitor.c
index 7f14255d3..e4e8c46a1 100644
--- a/src/dht/gnunet-dht-monitor.c
+++ b/src/dht/gnunet-dht-monitor.c
@@ -280,27 +280,6 @@ run (void *cls, char *const *args, const char *cfgfile,
280 NULL); 280 NULL);
281} 281}
282 282
283
284/**
285 * gnunet-dht-monitor command line options
286 */
287static struct GNUNET_GETOPT_CommandLineOption options[] = {
288 {'k', "key", "KEY",
289 gettext_noop ("the query key"),
290 1, &GNUNET_GETOPT_set_string, &query_key},
291 {'t', "type", "TYPE",
292 gettext_noop ("the type of data to look for"),
293 1, &GNUNET_GETOPT_set_uint, &block_type},
294 {'T', "timeout", "TIMEOUT",
295 gettext_noop ("how long should the monitor command run"),
296 1, &GNUNET_GETOPT_set_relative_time, &timeout_request},
297 {'V', "verbose", NULL,
298 gettext_noop ("be verbose (print progress information)"),
299 0, &GNUNET_GETOPT_set_one, &verbose},
300 GNUNET_GETOPT_OPTION_END
301};
302
303
304/** 283/**
305 * Entry point for gnunet-dht-monitor 284 * Entry point for gnunet-dht-monitor
306 * 285 *
@@ -311,6 +290,35 @@ static struct GNUNET_GETOPT_CommandLineOption options[] = {
311int 290int
312main (int argc, char *const *argv) 291main (int argc, char *const *argv)
313{ 292{
293 struct GNUNET_GETOPT_CommandLineOption options[] = {
294
295 GNUNET_GETOPT_OPTION_STRING ('k',
296 "key",
297 "KEY",
298 gettext_noop ("the query key"),
299 &query_key),
300
301 GNUNET_GETOPT_OPTION_SET_UINT ('t',
302 "type",
303 "TYPE",
304 gettext_noop ("the type of data to look for"),
305 &block_type),
306
307 GNUNET_GETOPT_OPTION_SET_RELATIVE_TIME ('T',
308 "timeout",
309 "TIMEOUT",
310 gettext_noop ("how long should the monitor command run"),
311 &timeout_request),
312
313 GNUNET_GETOPT_OPTION_SET_ONE ('V',
314 "verbose",
315 gettext_noop ("be verbose (print progress information)"),
316 &verbose),
317
318 GNUNET_GETOPT_OPTION_END
319 };
320
321
314 if (GNUNET_OK != GNUNET_STRINGS_get_utf8_args (argc, argv, &argc, &argv)) 322 if (GNUNET_OK != GNUNET_STRINGS_get_utf8_args (argc, argv, &argc, &argv))
315 return 2; 323 return 2;
316 324