Pádraig Brady wrote:
...
> Subject: [PATCH] doc: mention the texinfo documentation in --help
Thanks!
Good catch on moving hard-locale.h inclusions back.
> * src/system.h: Rename emit_bug_reporting_address() to
> emit_ancillary_info() and update it to remove the translation
> project address and instead mention how to invoke the
> texinfo documentation for each command. Also move the
> "hard-locale.h" include to the 8 files that now use it.
> * man/help2man: Strip the newly added texinfo reference from the
> --help output as a more verbose version is already added by help2man.
> Suggestion from C de-Avillez
...
> diff --git a/man/help2man b/man/help2man
...
> +my $PAT_INFO = _('For +complete +documentation');
You might want to make this regexp more specific,
just in case, to avoid accidentally filtering out
unrelated lines. Then again maybe not ;-)
I have a hard time imagining a sentence starting
like that in --help that should *not* be filtered out.
> # Start a new paragraph (if required) for these.
> s/([^\n])\n($PAT_BUGS|$PAT_AUTHOR)/$1\n\n$2/og;
> @@ -392,6 +393,11 @@ while (length)
> $sect = _('EXAMPLES');
> next;
> }
> + # Skip any texinfo reference as that's handled separately
> + if (s/($PAT_INFO).*\n//o)
> + {
> + next;
> + }
>
> # Copyright section
> if (/^Copyright +[(\xa9]/)
...
> diff --git a/src/system.h b/src/system.h
> index a15c298..a81020c 100644
> --- a/src/system.h
> +++ b/src/system.h
> @@ -635,9 +635,8 @@ Otherwise, units default to 1024 bytes (or 512 if
> POSIXLY_CORRECT is set).\n\
> "), program);
> }
>
> -#include "hard-locale.h"
> static inline void
> -emit_bug_reporting_address (void)
> +emit_ancillary_info (void)
> {
> printf (_("\nReport %s bugs to %s\n"), last_component (program_name),
> PACKAGE_BUGREPORT);
> @@ -646,17 +645,9 @@ emit_bug_reporting_address (void)
> PACKAGE_NAME, PACKAGE);
> fputs (_("General help using GNU software:
> <http://www.gnu.org/gethelp/>\n"),
> stdout);
> -
> - if (hard_locale (LC_MESSAGES))
> - {
> - /* TRANSLATORS: Replace LANG_CODE in this URL with your language code
> - <http://translationproject.org/team/LANG_CODE.html> to form one of
> - the URLs at http://translationproject.org/team/. Otherwise, replace
> - the entire URL with your translation team's email address. */
> - printf (_("Report %s translation bugs to "
> - "<http://translationproject.org/team/>\n"),
> - last_component (program_name));
> - }
> + printf (_("\
> +For complete documentation, run: info coreutils '%s invocation'\n\
> +"), last_component (program_name));
> }