diff options
author | Marcello Stanisci <marcello.stanisci@inria.fr> | 2017-03-15 15:28:41 +0100 |
---|---|---|
committer | Marcello Stanisci <marcello.stanisci@inria.fr> | 2017-03-15 15:28:41 +0100 |
commit | 5d6ed5fbda01a324d8d9b800928339d4a90343c3 (patch) | |
tree | b52f65dfc01e42f989df7aa2569ae69695fd9a54 /src/peerinfo-tool/gnunet-peerinfo.c | |
parent | 294393abdca9f482321696e9aaec64b1a0488607 (diff) | |
download | gnunet-5d6ed5fbda01a324d8d9b800928339d4a90343c3.tar.gz gnunet-5d6ed5fbda01a324d8d9b800928339d4a90343c3.zip |
Still porting to new getopt API.
Diffstat (limited to 'src/peerinfo-tool/gnunet-peerinfo.c')
-rw-r--r-- | src/peerinfo-tool/gnunet-peerinfo.c | 67 |
1 files changed, 42 insertions, 25 deletions
diff --git a/src/peerinfo-tool/gnunet-peerinfo.c b/src/peerinfo-tool/gnunet-peerinfo.c index a5907c63f..59ffe2efd 100644 --- a/src/peerinfo-tool/gnunet-peerinfo.c +++ b/src/peerinfo-tool/gnunet-peerinfo.c | |||
@@ -837,31 +837,48 @@ state_machine (void *cls) | |||
837 | int | 837 | int |
838 | main (int argc, char *const *argv) | 838 | main (int argc, char *const *argv) |
839 | { | 839 | { |
840 | static const struct GNUNET_GETOPT_CommandLineOption options[] = { | 840 | struct GNUNET_GETOPT_CommandLineOption options[] = { |
841 | {'n', "numeric", NULL, | 841 | GNUNET_GETOPT_OPTION_SET_ONE ('n', |
842 | gettext_noop ("don't resolve host names"), | 842 | "numeric", |
843 | 0, &GNUNET_GETOPT_set_one, &no_resolve}, | 843 | gettext_noop ("don't resolve host names"), |
844 | {'q', "quiet", NULL, | 844 | &no_resolve), |
845 | gettext_noop ("output only the identity strings"), | 845 | |
846 | 0, &GNUNET_GETOPT_set_one, &be_quiet}, | 846 | GNUNET_GETOPT_OPTION_SET_ONE ('q', |
847 | {'f', "friends", NULL, | 847 | "quiet", |
848 | gettext_noop ("include friend-only information"), | 848 | gettext_noop ("output only the identity strings"), |
849 | 0, &GNUNET_GETOPT_set_one, &include_friend_only}, | 849 | &be_quiet), |
850 | {'s', "self", NULL, | 850 | GNUNET_GETOPT_OPTION_SET_ONE ('f', |
851 | gettext_noop ("output our own identity only"), | 851 | "friends", |
852 | 0, &GNUNET_GETOPT_set_one, &get_self}, | 852 | gettext_noop ("include friend-only information"), |
853 | {'i', "info", NULL, | 853 | &include_friend_only), |
854 | gettext_noop ("list all known peers"), | 854 | |
855 | 0, &GNUNET_GETOPT_set_one, &get_info}, | 855 | GNUNET_GETOPT_OPTION_SET_ONE ('s', |
856 | {'d', "dump-hello", NULL, | 856 | "self", |
857 | gettext_noop ("dump hello to file"), | 857 | gettext_noop ("output our own identity only"), |
858 | 1, &GNUNET_GETOPT_set_string, &dump_hello}, | 858 | &get_self), |
859 | {'g', "get-hello", NULL, | 859 | |
860 | gettext_noop ("also output HELLO uri(s)"), | 860 | GNUNET_GETOPT_OPTION_SET_ONE ('i', |
861 | 0, &GNUNET_GETOPT_set_one, &get_uri}, | 861 | "info", |
862 | {'p', "put-hello", "HELLO", | 862 | gettext_noop ("list all known peers"), |
863 | gettext_noop ("add given HELLO uri to the database"), | 863 | &get_info), |
864 | 1, &GNUNET_GETOPT_set_string, &put_uri}, | 864 | |
865 | GNUNET_GETOPT_OPTION_STRING ('d', | ||
866 | "dump-hello", | ||
867 | NULL, | ||
868 | gettext_noop ("dump hello to file"), | ||
869 | &dump_hello), | ||
870 | |||
871 | GNUNET_GETOPT_OPTION_SET_ONE ('g', | ||
872 | "get-hello", | ||
873 | gettext_noop ("also output HELLO uri(s)"), | ||
874 | &get_uri), | ||
875 | |||
876 | GNUNET_GETOPT_OPTION_STRING ('p', | ||
877 | "put-hello", | ||
878 | "HELLO", | ||
879 | gettext_noop ("add given HELLO uri to the database"), | ||
880 | &put_uri), | ||
881 | |||
865 | GNUNET_GETOPT_OPTION_END | 882 | GNUNET_GETOPT_OPTION_END |
866 | }; | 883 | }; |
867 | int ret; | 884 | int ret; |