diff options
Diffstat (limited to 'src/fs/gnunet-publish.c')
-rw-r--r-- | src/fs/gnunet-publish.c | 151 |
1 files changed, 93 insertions, 58 deletions
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 | */ |
40 | static int verbose; | 40 | static unsigned int verbose; |
41 | 41 | ||
42 | /** | 42 | /** |
43 | * Handle to our configuration. | 43 | * Handle to our configuration. |
@@ -893,63 +893,98 @@ run (void *cls, | |||
893 | int | 893 | int |
894 | main (int argc, char *const *argv) | 894 | main (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 = |