diff options
author | madmurphy <madmurphy333@gmail.com> | 2022-02-15 00:07:16 +0000 |
---|---|---|
committer | madmurphy <madmurphy333@gmail.com> | 2022-02-15 00:07:16 +0000 |
commit | 679d390e4755cb4360529f5ad0294d1461058f3c (patch) | |
tree | 54d06fc40f7ad0f5cb9a814df028abcf042332fe /src/fs | |
parent | 336acc33010eb725c873791ed6eb9039cb1aedd2 (diff) | |
download | gnunet-679d390e4755cb4360529f5ad0294d1461058f3c.tar.gz gnunet-679d390e4755cb4360529f5ad0294d1461058f3c.zip |
`gnunet-search`: Reduce the help page and include Alessio's suggestions
Diffstat (limited to 'src/fs')
-rw-r--r-- | src/fs/gnunet-search.c | 53 |
1 files changed, 15 insertions, 38 deletions
diff --git a/src/fs/gnunet-search.c b/src/fs/gnunet-search.c index b08e3f70b..7e2e4d2a6 100644 --- a/src/fs/gnunet-search.c +++ b/src/fs/gnunet-search.c | |||
@@ -49,7 +49,7 @@ | |||
49 | #if HAVE_LIBEXTRACTOR | 49 | #if HAVE_LIBEXTRACTOR |
50 | #define DEFAULT_META_FORMAT " %t: %p\n" | 50 | #define DEFAULT_META_FORMAT " %t: %p\n" |
51 | #define HELP_DEFAULT_META_FORMAT " %t: %p\\n" | 51 | #define HELP_DEFAULT_META_FORMAT " %t: %p\\n" |
52 | #define HELP_EXTRACTOR_TEXTADD ", %t is the property type" | 52 | #define HELP_EXTRACTOR_TEXTADD ", %t" |
53 | #else | 53 | #else |
54 | #define DEFAULT_META_FORMAT " MetaType #%i: %p\n" | 54 | #define DEFAULT_META_FORMAT " MetaType #%i: %p\n" |
55 | #define HELP_DEFAULT_META_FORMAT " MetaType #%i: %p\\n" | 55 | #define HELP_DEFAULT_META_FORMAT " MetaType #%i: %p\\n" |
@@ -705,43 +705,28 @@ main (int argc, char *const *argv) | |||
705 | "dir-printf", | 705 | "dir-printf", |
706 | "FORMAT", | 706 | "FORMAT", |
707 | gettext_noop ("write search results for directories according to " | 707 | gettext_noop ("write search results for directories according to " |
708 | "FORMAT; the format specifiers supported here are " | 708 | "FORMAT; accepted placeholders are: %a, %f, %j, %l, %m, " |
709 | "identical to those supported in the --printf argument " | 709 | "%n, %s; defaults to the value of --printf when omitted " |
710 | "(please refer to it for more information); if missing, " | 710 | "or to `" HELP_DEFAULT_DIR_FORMAT "` if --printf is " |
711 | "--dir-printf defaults to --printf; if --printf is " | 711 | "omitted too"), |
712 | "missing too --dir-printf defaults to `" | ||
713 | HELP_DEFAULT_DIR_FORMAT "`"), | ||
714 | &dir_format_string), | 712 | &dir_format_string), |
715 | GNUNET_GETOPT_option_string ( | 713 | GNUNET_GETOPT_option_string ( |
716 | 'f', | 714 | 'f', |
717 | "printf", | 715 | "printf", |
718 | "FORMAT", | 716 | "FORMAT", |
719 | gettext_noop ("write search results according to FORMAT, where %a is " | 717 | gettext_noop ("write search results according to FORMAT; accepted " |
720 | "the complete list of all the printable metadata " | 718 | "placeholders are: %a, %f, %j, %l, %m, %n, %s; defaults " |
721 | "available (each member will be displayed according to " | 719 | "to `" HELP_DEFAULT_FILE_FORMAT "` when omitted"), |
722 | "the --iter-printf argument) - use %j for printing only " | ||
723 | "one field - %f is the file's name, %l is the file name's " | ||
724 | "length, %m is the file's mime type, %n is the search " | ||
725 | "result number, %s is the file's size in bytes and %u is " | ||
726 | "the file's URI; the %a and %j specifiers optionally " | ||
727 | "support metatype filtering via hash sign (e.g. `%5#j` " | ||
728 | "prints a book title, if present - see libextractor's " | ||
729 | "metatypes for the complete list of numerical " | ||
730 | "identifiers); if missing, --printf defaults to `" | ||
731 | HELP_DEFAULT_FILE_FORMAT "`"), | ||
732 | &format_string), | 720 | &format_string), |
733 | GNUNET_GETOPT_option_string ( | 721 | GNUNET_GETOPT_option_string ( |
734 | 'i', | 722 | 'i', |
735 | "iter-printf", | 723 | "iter-printf", |
736 | "FORMAT", | 724 | "FORMAT", |
737 | gettext_noop ("when the %a or %j format specifiers appear in --printf " | 725 | gettext_noop ("when the %a or %j placeholders appear in --printf or " |
738 | "or --dir-printf, list each metadata property according " | 726 | "--dir-printf, list each metadata property according to " |
739 | "to FORMAT, where %p is the property's content, %l is the " | 727 | "FORMAT; accepted placeholders are: %i, %l, %n, %p" |
740 | "content's length in bytes" HELP_EXTRACTOR_TEXTADD ", %i " | 728 | HELP_EXTRACTOR_TEXTADD ", %w; defaults to `" |
741 | "is the property type's unique identifier, %n is the " | 729 | HELP_DEFAULT_META_FORMAT "` when omitted"), |
742 | "property number and %w is the name of the plugin that " | ||
743 | "provided the information; if missing, --iter-printf " | ||
744 | "defaults to `" HELP_DEFAULT_META_FORMAT "`"), | ||
745 | &meta_format_string), | 730 | &meta_format_string), |
746 | GNUNET_GETOPT_option_uint ('N', | 731 | GNUNET_GETOPT_option_uint ('N', |
747 | "results", | 732 | "results", |
@@ -787,22 +772,14 @@ main (int argc, char *const *argv) | |||
787 | GNUNET_GETOPT_OPTION_END }; | 772 | GNUNET_GETOPT_OPTION_END }; |
788 | 773 | ||
789 | if (GNUNET_OK != GNUNET_STRINGS_get_utf8_args (argc, argv, &argc, &argv)) | 774 | if (GNUNET_OK != GNUNET_STRINGS_get_utf8_args (argc, argv, &argc, &argv)) |
790 | return 2; | 775 | return 12; |
791 | 776 | ||
792 | if (GNUNET_SYSERR == | 777 | if (GNUNET_SYSERR == |
793 | GNUNET_PROGRAM_run (argc, | 778 | GNUNET_PROGRAM_run (argc, |
794 | argv, | 779 | argv, |
795 | "gnunet-search [OPTIONS] KEYWORD1 KEYWORD2 ...", | 780 | "gnunet-search [OPTIONS] KEYWORD1 KEYWORD2 ...", |
796 | gettext_noop ("Search for files that have been " | 781 | gettext_noop ("Search for files that have been " |
797 | "published on GNUnet\n\nKeywords " | 782 | "published on GNUnet\n"), |
798 | "should start with a plus sign to " | ||
799 | "indicate that they are required -\n" | ||
800 | "e.g. `gnunet-search commons gpl` " | ||
801 | "searches for files that match " | ||
802 | "*either*\n\"commons\" or \"gpl\", " | ||
803 | "whereas `gnunet-search +commons " | ||
804 | "+gpl` searches for files\nthat match " | ||
805 | "*both* \"commons\" and \"gpl\".\n"), | ||
806 | options, | 783 | options, |
807 | &run, | 784 | &run, |
808 | NULL)) | 785 | NULL)) |