aboutsummaryrefslogtreecommitdiff
path: root/src/fs
diff options
context:
space:
mode:
Diffstat (limited to 'src/fs')
-rw-r--r--src/fs/fs_getopt.c79
-rw-r--r--src/fs/gnunet-auto-share.c54
-rw-r--r--src/fs/gnunet-download.c74
-rw-r--r--src/fs/gnunet-fs-profiler.c30
-rw-r--r--src/fs/gnunet-fs.c13
-rw-r--r--src/fs/gnunet-publish.c151
-rw-r--r--src/fs/gnunet-search.c58
-rw-r--r--src/fs/gnunet-unindex.c10
8 files changed, 312 insertions, 157 deletions
diff --git a/src/fs/fs_getopt.c b/src/fs/fs_getopt.c
index f78e311d3..bfe45957e 100644
--- a/src/fs/fs_getopt.c
+++ b/src/fs/fs_getopt.c
@@ -25,6 +25,7 @@
25 */ 25 */
26#include "platform.h" 26#include "platform.h"
27#include "gnunet_fs_service.h" 27#include "gnunet_fs_service.h"
28#include "gnunet_getopt_lib.h"
28#include "fs_api.h" 29#include "fs_api.h"
29 30
30/* ******************** command-line option parsing API ******************** */ 31/* ******************** command-line option parsing API ******************** */
@@ -41,10 +42,10 @@
41 * @param value command line argument given 42 * @param value command line argument given
42 * @return GNUNET_OK on success 43 * @return GNUNET_OK on success
43 */ 44 */
44int 45static int
45GNUNET_FS_getopt_set_keywords (struct GNUNET_GETOPT_CommandLineProcessorContext 46getopt_set_keywords (struct GNUNET_GETOPT_CommandLineProcessorContext
46 *ctx, void *scls, const char *option, 47 *ctx, void *scls, const char *option,
47 const char *value) 48 const char *value)
48{ 49{
49 struct GNUNET_FS_Uri **uri = scls; 50 struct GNUNET_FS_Uri **uri = scls;
50 struct GNUNET_FS_Uri *u = *uri; 51 struct GNUNET_FS_Uri *u = *uri;
@@ -107,6 +108,34 @@ GNUNET_FS_getopt_set_keywords (struct GNUNET_GETOPT_CommandLineProcessorContext
107 return GNUNET_OK; 108 return GNUNET_OK;
108} 109}
109 110
111/**
112 * Allow user to specify keywords.
113 *
114 * @param shortName short name of the option
115 * @param name long name of the option
116 * @param argumentHelp help text for the option argument
117 * @param description long help text for the option
118 * @param[out] topKeywords set to the desired value
119 */
120struct GNUNET_GETOPT_CommandLineOption
121GNUNET_FS_GETOPT_KEYWORDS (char shortName,
122 const char *name,
123 const char *argumentHelp,
124 const char *description,
125 struct GNUNET_FS_Uri **topKeywords)
126{
127 struct GNUNET_GETOPT_CommandLineOption clo = {
128 .shortName = shortName,
129 .name = name,
130 .argumentHelp = argumentHelp,
131 .description = description,
132 .require_argument = 1,
133 .processor = &getopt_set_keywords,
134 .scls = (void *) topKeywords
135 };
136
137 return clo;
138}
110 139
111/** 140/**
112 * Command-line option parser function that allows the user to specify 141 * Command-line option parser function that allows the user to specify
@@ -120,11 +149,11 @@ GNUNET_FS_getopt_set_keywords (struct GNUNET_GETOPT_CommandLineProcessorContext
120 * @param value command line argument given 149 * @param value command line argument given
121 * @return #GNUNET_OK on success 150 * @return #GNUNET_OK on success
122 */ 151 */
123int 152static int
124GNUNET_FS_getopt_set_metadata (struct GNUNET_GETOPT_CommandLineProcessorContext *ctx, 153getopt_set_metadata (struct GNUNET_GETOPT_CommandLineProcessorContext *ctx,
125 void *scls, 154 void *scls,
126 const char *option, 155 const char *option,
127 const char *value) 156 const char *value)
128{ 157{
129 struct GNUNET_CONTAINER_MetaData **mm = scls; 158 struct GNUNET_CONTAINER_MetaData **mm = scls;
130#if HAVE_EXTRACTOR_H && HAVE_LIBEXTRACTOR 159#if HAVE_EXTRACTOR_H && HAVE_LIBEXTRACTOR
@@ -200,4 +229,36 @@ GNUNET_FS_getopt_set_metadata (struct GNUNET_GETOPT_CommandLineProcessorContext
200 return GNUNET_OK; 229 return GNUNET_OK;
201} 230}
202 231
232/**
233 * Allow user to specify metadata.
234 *
235 * @param shortName short name of the option
236 * @param name long name of the option
237 * @param argumentHelp help text for the option argument
238 * @param description long help text for the option
239 * @param[out] metadata set to the desired value
240 */
241struct GNUNET_GETOPT_CommandLineOption
242GNUNET_FS_GETOPT_METADATA (char shortName,
243 const char *name,
244 const char *argumentHelp,
245 const char *description,
246 struct GNUNET_CONTAINER_MetaData **meta)
247{
248 struct GNUNET_GETOPT_CommandLineOption clo = {
249 .shortName = shortName,
250 .name = name,
251 .argumentHelp = argumentHelp,
252 .description = description,
253 .require_argument = 1,
254 .processor = &getopt_set_metadata,
255 .scls = (void *) meta
256 };
257
258 return clo;
259}
260
261
262
263
203/* end of fs_getopt.c */ 264/* end of fs_getopt.c */
diff --git a/src/fs/gnunet-auto-share.c b/src/fs/gnunet-auto-share.c
index cc0111111..2f980520a 100644
--- a/src/fs/gnunet-auto-share.c
+++ b/src/fs/gnunet-auto-share.c
@@ -72,7 +72,7 @@ static int ret;
72/** 72/**
73 * Are we running 'verbosely'? 73 * Are we running 'verbosely'?
74 */ 74 */
75static int verbose; 75static unsigned int verbose;
76 76
77/** 77/**
78 * Configuration to use. 78 * Configuration to use.
@@ -759,26 +759,38 @@ free_item (void *cls,
759int 759int
760main (int argc, char *const *argv) 760main (int argc, char *const *argv)
761{ 761{
762 static const struct GNUNET_GETOPT_CommandLineOption options[] = { 762 struct GNUNET_GETOPT_CommandLineOption options[] = {
763 {'a', "anonymity", "LEVEL", 763
764 gettext_noop ("set the desired LEVEL of sender-anonymity"), 764 GNUNET_GETOPT_OPTION_SET_UINT ('a',
765 1, &GNUNET_GETOPT_set_uint, &anonymity_level}, 765 "anonymity",
766 {'d', "disable-creation-time", NULL, 766 "LEVEL",
767 gettext_noop 767 gettext_noop ("set the desired LEVEL of sender-anonymity"),
768 ("disable adding the creation time to the metadata of the uploaded file"), 768 &anonymity_level),
769 0, &GNUNET_GETOPT_set_one, &do_disable_creation_time}, 769
770 {'D', "disable-extractor", NULL, 770 GNUNET_GETOPT_OPTION_SET_ONE ('d',
771 gettext_noop ("do not use libextractor to add keywords or metadata"), 771 "disable-creation-time",
772 0, &GNUNET_GETOPT_set_one, &disable_extractor}, 772 gettext_noop ("disable adding the creation time to the metadata of the uploaded file"),
773 {'p', "priority", "PRIORITY", 773 &do_disable_creation_time),
774 gettext_noop ("specify the priority of the content"), 774
775 1, &GNUNET_GETOPT_set_uint, &content_priority}, 775 GNUNET_GETOPT_OPTION_SET_ONE ('D',
776 {'r', "replication", "LEVEL", 776 "disable-extractor",
777 gettext_noop ("set the desired replication LEVEL"), 777 gettext_noop ("do not use libextractor to add keywords or metadata"),
778 1, &GNUNET_GETOPT_set_uint, &replication_level}, 778 &disable_extractor),
779 {'V', "verbose", NULL, 779
780 gettext_noop ("be verbose (print progress information)"), 780 GNUNET_GETOPT_OPTION_SET_UINT ('p',
781 0, &GNUNET_GETOPT_set_one, &verbose}, 781 "priority",
782 "PRIORITY",
783 gettext_noop ("specify the priority of the content"),
784 &content_priority),
785
786 GNUNET_GETOPT_OPTION_SET_UINT ('r',
787 "replication",
788 "LEVEL",
789 gettext_noop ("set the desired replication LEVEL"),
790 &replication_level),
791
792 GNUNET_GETOPT_OPTION_VERBOSE (&verbose),
793
782 GNUNET_GETOPT_OPTION_END 794 GNUNET_GETOPT_OPTION_END
783 }; 795 };
784 struct WorkItem *wi; 796 struct WorkItem *wi;
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 @@
30 30
31static int ret; 31static int ret;
32 32
33static int verbose; 33static unsigned int verbose;
34 34
35static int delete_incomplete; 35static int delete_incomplete;
36 36
@@ -299,33 +299,51 @@ run (void *cls, char *const *args, const char *cfgfile,
299int 299int
300main (int argc, char *const *argv) 300main (int argc, char *const *argv)
301{ 301{
302 static const struct GNUNET_GETOPT_CommandLineOption options[] = { 302 struct GNUNET_GETOPT_CommandLineOption options[] = {
303 {'a', "anonymity", "LEVEL", 303 GNUNET_GETOPT_OPTION_SET_UINT ('a',
304 gettext_noop ("set the desired LEVEL of receiver-anonymity"), 304 "anonymity",
305 1, &GNUNET_GETOPT_set_uint, &anonymity}, 305 "LEVEL",
306 {'D', "delete-incomplete", NULL, 306 gettext_noop ("set the desired LEVEL of receiver-anonymity"),
307 gettext_noop ("delete incomplete downloads (when aborted with CTRL-C)"), 307 &anonymity),
308 0, &GNUNET_GETOPT_set_one, &delete_incomplete}, 308
309 {'n', "no-network", NULL, 309 GNUNET_GETOPT_OPTION_SET_ONE ('D',
310 gettext_noop ("only search the local peer (no P2P network search)"), 310 "delete-incomplete",
311 0, &GNUNET_GETOPT_set_one, &local_only}, 311 gettext_noop ("delete incomplete downloads (when aborted with CTRL-C)"),
312 {'o', "output", "FILENAME", 312 &delete_incomplete),
313 gettext_noop ("write the file to FILENAME"), 313
314 1, &GNUNET_GETOPT_set_string, &filename}, 314 GNUNET_GETOPT_OPTION_SET_ONE ('n',
315 {'p', "parallelism", "DOWNLOADS", 315 "no-network",
316 gettext_noop 316 gettext_noop ("only search the local peer (no P2P network search)"),
317 ("set the maximum number of parallel downloads that is allowed"), 317 &local_only),
318 1, &GNUNET_GETOPT_set_uint, &parallelism}, 318
319 {'r', "request-parallelism", "REQUESTS", 319 GNUNET_GETOPT_OPTION_STRING ('o',
320 gettext_noop 320 "output",
321 ("set the maximum number of parallel requests for blocks that is allowed"), 321 "FILENAME",
322 1, &GNUNET_GETOPT_set_uint, &request_parallelism}, 322 gettext_noop ("write the file to FILENAME"),
323 {'R', "recursive", NULL, 323 &filename),
324 gettext_noop ("download a GNUnet directory recursively"), 324
325 0, &GNUNET_GETOPT_set_one, &do_recursive}, 325 GNUNET_GETOPT_OPTION_SET_UINT ('p',
326 {'V', "verbose", NULL, 326 "parallelism",
327 gettext_noop ("be verbose (print progress information)"), 327 "DOWNLOADS",
328 0, &GNUNET_GETOPT_increment_value, &verbose}, 328 gettext_noop ("set the maximum number of parallel downloads that is allowed"),
329 &parallelism),
330
331 GNUNET_GETOPT_OPTION_SET_UINT ('r',
332 "request-parallelism",
333 "REQUESTS",
334 gettext_noop ("set the maximum number of parallel requests for blocks that is allowed"),
335 &request_parallelism),
336
337 GNUNET_GETOPT_OPTION_SET_ONE ('R',
338 "recursive",
339 gettext_noop ("download a GNUnet directory recursively"),
340 &do_recursive),
341
342 GNUNET_GETOPT_OPTION_INCREMENT_VALUE ('V',
343 "verbose",
344 gettext_noop ("be verbose (print progress information)"),
345 &verbose),
346
329 GNUNET_GETOPT_OPTION_END 347 GNUNET_GETOPT_OPTION_END
330 }; 348 };
331 349
diff --git a/src/fs/gnunet-fs-profiler.c b/src/fs/gnunet-fs-profiler.c
index cfbe57bbd..fb99d8f90 100644
--- a/src/fs/gnunet-fs-profiler.c
+++ b/src/fs/gnunet-fs-profiler.c
@@ -203,16 +203,26 @@ run (void *cls, char *const *args, const char *cfgfile,
203int 203int
204main (int argc, char *const *argv) 204main (int argc, char *const *argv)
205{ 205{
206 static const struct GNUNET_GETOPT_CommandLineOption options[] = { 206 struct GNUNET_GETOPT_CommandLineOption options[] = {
207 {'n', "num-peers", "COUNT", 207
208 gettext_noop ("run the experiment with COUNT peers"), 208 GNUNET_GETOPT_OPTION_SET_UINT ('n',
209 1, &GNUNET_GETOPT_set_uint, &num_peers}, 209 "num-peers",
210 {'H', "hosts", "HOSTFILE", 210 "COUNT",
211 gettext_noop ("specifies name of a file with the HOSTS the testbed should use"), 211 gettext_noop ("run the experiment with COUNT peers"),
212 1, &GNUNET_GETOPT_set_string, &host_filename}, 212 &num_peers),
213 {'t', "timeout", "DELAY", 213
214 gettext_noop ("automatically terminate experiment after DELAY"), 214 GNUNET_GETOPT_OPTION_STRING ('H',
215 1, &GNUNET_GETOPT_set_relative_time, &timeout}, 215 "hosts",
216 "HOSTFILE",
217 gettext_noop ("specifies name of a file with the HOSTS the testbed should use"),
218 &host_filename),
219
220 GNUNET_GETOPT_OPTION_SET_RELATIVE_TIME ('t',
221 "timeout",
222 "DELAY",
223 gettext_noop ("automatically terminate experiment after DELAY"),
224 &timeout),
225
216 GNUNET_GETOPT_OPTION_END 226 GNUNET_GETOPT_OPTION_END
217 }; 227 };
218 if (GNUNET_OK != GNUNET_STRINGS_get_utf8_args (argc, argv, &argc, &argv)) 228 if (GNUNET_OK != GNUNET_STRINGS_get_utf8_args (argc, argv, &argc, &argv))
diff --git a/src/fs/gnunet-fs.c b/src/fs/gnunet-fs.c
index 7c20e025f..2b24b7124 100644
--- a/src/fs/gnunet-fs.c
+++ b/src/fs/gnunet-fs.c
@@ -43,7 +43,7 @@ static int list_indexed_files;
43/** 43/**
44 * Option -v given? 44 * Option -v given?
45 */ 45 */
46static int verbose; 46static unsigned int verbose;
47 47
48 48
49/** 49/**
@@ -112,10 +112,13 @@ run (void *cls, char *const *args, const char *cfgfile,
112int 112int
113main (int argc, char *const *argv) 113main (int argc, char *const *argv)
114{ 114{
115 static struct GNUNET_GETOPT_CommandLineOption options[] = { 115 struct GNUNET_GETOPT_CommandLineOption options[] = {
116 {'i', "list-indexed", NULL, 116
117 gettext_noop ("print a list of all indexed files"), 0, 117 GNUNET_GETOPT_OPTION_SET_ONE ('i',
118 &GNUNET_GETOPT_set_one, &list_indexed_files}, 118 "list-indexed",
119 gettext_noop ("print a list of all indexed files"),
120 &list_indexed_files),
121
119 GNUNET_GETOPT_OPTION_VERBOSE (&verbose), 122 GNUNET_GETOPT_OPTION_VERBOSE (&verbose),
120 GNUNET_GETOPT_OPTION_END 123 GNUNET_GETOPT_OPTION_END
121 }; 124 };
diff --git a/src/fs/gnunet-publish.c b/src/fs/gnunet-publish.c
index a563d7b7a..2229e45e7 100644
--- a/src/fs/gnunet-publish.c
+++ b/src/fs/gnunet-publish.c
@@ -37,7 +37,7 @@ static int ret;
37/** 37/**
38 * Command line option 'verbose' set 38 * Command line option 'verbose' set
39 */ 39 */
40static int verbose; 40static unsigned int verbose;
41 41
42/** 42/**
43 * Handle to our configuration. 43 * Handle to our configuration.
@@ -893,63 +893,98 @@ run (void *cls,
893int 893int
894main (int argc, char *const *argv) 894main (int argc, char *const *argv)
895{ 895{
896 static const struct GNUNET_GETOPT_CommandLineOption options[] = { 896 struct GNUNET_GETOPT_CommandLineOption options[] = {
897 {'a', "anonymity", "LEVEL", 897 GNUNET_GETOPT_OPTION_SET_UINT ('a',
898 gettext_noop ("set the desired LEVEL of sender-anonymity"), 898 "anonymity",
899 1, &GNUNET_GETOPT_set_uint, &bo.anonymity_level}, 899 "LEVEL",
900 {'d', "disable-creation-time", NULL, 900 gettext_noop ("set the desired LEVEL of sender-anonymity"),
901 gettext_noop 901 &bo.anonymity_level),
902 ("disable adding the creation time to the metadata of the uploaded file"), 902
903 0, &GNUNET_GETOPT_set_one, &do_disable_creation_time}, 903 GNUNET_GETOPT_OPTION_SET_ONE ('d',
904 {'D', "disable-extractor", NULL, 904 "disable-creation-time",
905 gettext_noop ("do not use libextractor to add keywords or metadata"), 905 gettext_noop ("disable adding the creation time to the "
906 0, &GNUNET_GETOPT_set_one, &disable_extractor}, 906 "metadata of the uploaded file"),
907 {'e', "extract", NULL, 907 &do_disable_creation_time),
908 gettext_noop 908
909 ("print list of extracted keywords that would be used, but do not perform upload"), 909 GNUNET_GETOPT_OPTION_SET_ONE ('D',
910 0, &GNUNET_GETOPT_set_one, &extract_only}, 910 "disable-extractor",
911 {'k', "key", "KEYWORD", 911 gettext_noop ("do not use libextractor to add keywords or metadata"),
912 gettext_noop 912 &disable_extractor),
913 ("add an additional keyword for the top-level file or directory" 913
914 " (this option can be specified multiple times)"), 914 GNUNET_GETOPT_OPTION_SET_ONE ('e',
915 1, &GNUNET_FS_getopt_set_keywords, &topKeywords}, 915 "extract",
916 {'m', "meta", "TYPE:VALUE", 916 gettext_noop ("print list of extracted keywords that would "
917 gettext_noop ("set the meta-data for the given TYPE to the given VALUE"), 917 "be used, but do not perform upload"),
918 1, &GNUNET_FS_getopt_set_metadata, &meta}, 918 &extract_only),
919 {'n', "noindex", NULL, 919
920 gettext_noop ("do not index, perform full insertion (stores entire " 920 GNUNET_FS_GETOPT_KEYWORDS ('k',
921 "file in encrypted form in GNUnet database)"), 921 "key",
922 0, &GNUNET_GETOPT_set_one, &do_insert}, 922 "KEYWORD",
923 {'N', "next", "ID", 923 gettext_noop ("add an additional keyword for the top-level "
924 gettext_noop 924 "file or directory (this option can be specified multiple times)"),
925 ("specify ID of an updated version to be published in the future" 925 &topKeywords),
926 " (for namespace insertions only)"), 926
927 1, &GNUNET_GETOPT_set_string, &next_id}, 927 GNUNET_FS_GETOPT_METADATA ('m',
928 {'p', "priority", "PRIORITY", 928 "meta",
929 gettext_noop ("specify the priority of the content"), 929 "TYPE:VALUE",
930 1, &GNUNET_GETOPT_set_uint, &bo.content_priority}, 930 gettext_noop ("set the meta-data for the given TYPE to the given VALUE"),
931 {'P', "pseudonym", "NAME", 931 &meta),
932 gettext_noop 932
933 ("publish the files under the pseudonym NAME (place file into namespace)"), 933 GNUNET_GETOPT_OPTION_SET_ONE ('n',
934 1, &GNUNET_GETOPT_set_string, &pseudonym}, 934 "noindex",
935 {'r', "replication", "LEVEL", 935 gettext_noop ("do not index, perform full insertion (stores "
936 gettext_noop ("set the desired replication LEVEL"), 936 "entire file in encrypted form in GNUnet database)"),
937 1, &GNUNET_GETOPT_set_uint, &bo.replication_level}, 937 &do_insert),
938 {'s', "simulate-only", NULL, 938
939 gettext_noop ("only simulate the process but do not do any " 939 GNUNET_GETOPT_OPTION_STRING ('N',
940 "actual publishing (useful to compute URIs)"), 940 "next",
941 0, &GNUNET_GETOPT_set_one, &do_simulate}, 941 "ID",
942 {'t', "this", "ID", 942 gettext_noop ("specify ID of an updated version to be "
943 gettext_noop ("set the ID of this version of the publication" 943 "published in the future (for namespace insertions only)"),
944 " (for namespace insertions only)"), 944 &next_id),
945 1, &GNUNET_GETOPT_set_string, &this_id}, 945
946 {'u', "uri", "URI", 946 GNUNET_GETOPT_OPTION_SET_UINT ('p',
947 gettext_noop ("URI to be published (can be used instead of passing a " 947 "priority",
948 "file to add keywords to the file with the respective URI)"), 948 "PRIORITY",
949 1, &GNUNET_GETOPT_set_string, &uri_string}, 949 gettext_noop ("specify the priority of the content"),
950 {'V', "verbose", NULL, 950 &bo.content_priority),
951 gettext_noop ("be verbose (print progress information)"), 951
952 0, &GNUNET_GETOPT_set_one, &verbose}, 952 GNUNET_GETOPT_OPTION_STRING ('P',
953 "pseudonym",
954 "NAME",
955 gettext_noop ("publish the files under the pseudonym "
956 "NAME (place file into namespace)"),
957 &pseudonym),
958
959 GNUNET_GETOPT_OPTION_SET_UINT ('r',
960 "replication",
961 "LEVEL",
962 gettext_noop ("set the desired replication LEVEL"),
963 &bo.replication_level),
964
965
966 GNUNET_GETOPT_OPTION_SET_ONE ('s',
967 "simulate-only",
968 gettext_noop ("only simulate the process but do not do "
969 "any actual publishing (useful to compute URIs)"),
970 &do_simulate),
971
972 GNUNET_GETOPT_OPTION_STRING ('t',
973 "this",
974 "ID",
975 gettext_noop ("set the ID of this version of the publication "
976 "(for namespace insertions only)"),
977 &this_id),
978
979 GNUNET_GETOPT_OPTION_STRING ('u',
980 "uri",
981 "URI",
982 gettext_noop ("URI to be published (can be used instead of passing a "
983 "file to add keywords to the file with the respective URI)"),
984 &uri_string),
985
986 GNUNET_GETOPT_OPTION_VERBOSE (&verbose),
987
953 GNUNET_GETOPT_OPTION_END 988 GNUNET_GETOPT_OPTION_END
954 }; 989 };
955 bo.expiration_time = 990 bo.expiration_time =
diff --git a/src/fs/gnunet-search.c b/src/fs/gnunet-search.c
index dfe6d0e75..22e790cf3 100644
--- a/src/fs/gnunet-search.c
+++ b/src/fs/gnunet-search.c
@@ -51,7 +51,7 @@ static unsigned int results_limit;
51 51
52static unsigned int results; 52static unsigned int results;
53 53
54static int verbose; 54static unsigned int verbose;
55 55
56static int local_only; 56static int local_only;
57 57
@@ -305,26 +305,42 @@ run (void *cls, char *const *args, const char *cfgfile,
305int 305int
306main (int argc, char *const *argv) 306main (int argc, char *const *argv)
307{ 307{
308 static const struct GNUNET_GETOPT_CommandLineOption options[] = { 308 struct GNUNET_GETOPT_CommandLineOption options[] = {
309 {'a', "anonymity", "LEVEL", 309
310 gettext_noop ("set the desired LEVEL of receiver-anonymity"), 310 GNUNET_GETOPT_OPTION_SET_UINT ('a',
311 1, &GNUNET_GETOPT_set_uint, &anonymity}, 311 "anonymity",
312 {'n', "no-network", NULL, 312 "LEVEL",
313 gettext_noop ("only search the local peer (no P2P network search)"), 313 gettext_noop ("set the desired LEVEL of receiver-anonymity"),
314 0, &GNUNET_GETOPT_set_one, &local_only}, 314 &anonymity),
315 {'o', "output", "PREFIX", 315
316 gettext_noop ("write search results to file starting with PREFIX"), 316
317 1, &GNUNET_GETOPT_set_string, &output_filename}, 317 GNUNET_GETOPT_OPTION_SET_ONE ('n',
318 {'t', "timeout", "DELAY", 318 "no-network",
319 gettext_noop ("automatically terminate search after DELAY"), 319 gettext_noop ("only search the local peer (no P2P network search)"),
320 1, &GNUNET_GETOPT_set_relative_time, &timeout}, 320 &local_only),
321 {'V', "verbose", NULL, 321
322 gettext_noop ("be verbose (print progress information)"), 322 GNUNET_GETOPT_OPTION_STRING ('o',
323 0, &GNUNET_GETOPT_set_one, &verbose}, 323 "output",
324 {'N', "results", "VALUE", 324 "PREFIX",
325 gettext_noop 325 gettext_noop ("write search results to file starting with PREFIX"),
326 ("automatically terminate search after VALUE results are found"), 326 &output_filename),
327 1, &GNUNET_GETOPT_set_uint, &results_limit}, 327
328 GNUNET_GETOPT_OPTION_SET_RELATIVE_TIME ('t',
329 "timeout",
330 "DELAY",
331 gettext_noop ("automatically terminate search after DELAY"),
332 &timeout),
333
334
335 GNUNET_GETOPT_OPTION_VERBOSE (&verbose),
336
337 GNUNET_GETOPT_OPTION_SET_UINT ('N',
338 "results",
339 "VALUE",
340 gettext_noop ("automatically terminate search "
341 "after VALUE results are found"),
342 &results_limit),
343
328 GNUNET_GETOPT_OPTION_END 344 GNUNET_GETOPT_OPTION_END
329 }; 345 };
330 346
diff --git a/src/fs/gnunet-unindex.c b/src/fs/gnunet-unindex.c
index 40fa13b62..c53a85fb4 100644
--- a/src/fs/gnunet-unindex.c
+++ b/src/fs/gnunet-unindex.c
@@ -30,7 +30,7 @@
30 30
31static int ret; 31static int ret;
32 32
33static int verbose; 33static unsigned int verbose;
34 34
35static const struct GNUNET_CONFIGURATION_Handle *cfg; 35static const struct GNUNET_CONFIGURATION_Handle *cfg;
36 36
@@ -162,10 +162,10 @@ run (void *cls, char *const *args, const char *cfgfile,
162int 162int
163main (int argc, char *const *argv) 163main (int argc, char *const *argv)
164{ 164{
165 static const struct GNUNET_GETOPT_CommandLineOption options[] = { 165 struct GNUNET_GETOPT_CommandLineOption options[] = {
166 {'V', "verbose", NULL, 166
167 gettext_noop ("be verbose (print progress information)"), 167 GNUNET_GETOPT_OPTION_VERBOSE (&verbose),
168 0, &GNUNET_GETOPT_set_one, &verbose}, 168
169 GNUNET_GETOPT_OPTION_END 169 GNUNET_GETOPT_OPTION_END
170 }; 170 };
171 171