]> git.ipfire.org Git - thirdparty/coreutils.git/commitdiff
doc: reference online info pages directly from man pages
authorPádraig Brady <P@draigBrady.com>
Wed, 10 Sep 2014 10:53:50 +0000 (11:53 +0100)
committerPádraig Brady <P@draigBrady.com>
Thu, 11 Sep 2014 09:53:06 +0000 (10:53 +0100)
* src/system.h (emit_ancillary_info): Add a direct reference
to the corresponding online info documentation.  Corresponding
redirects were put in place on www.gnu.org to allow for concise links.
* help2man: Adjust to add the "online help" link (and subsequent
translation bugs link) to a "REPORTING BUGS" section.
Also add the concise links for further information in --help
to the "SEE ALSO" section, and dispense with the more verbose
default for that.

man/help2man
src/system.h

index bfeb9897233b5014aa7026fc2bd3aeae806bdbb1..fe786ac2290ba83746b9272992f724706c7cf747 100755 (executable)
@@ -405,16 +405,19 @@ s/\\/\x82/g;
 # "(?:[\\w-]+ +)?" in the bug reporting pattern is used to indicate an
 # optional word, so that either "Report bugs" or "Report _program_ bugs" will
 # be matched.
-my $PAT_BUGS          = _('Report +(?:[\w-]+ +)?bugs|Email +bug +reports +to');
+my $PAT_BUGS          = _('Report +(?:[\w-]+ +)?bugs|' .
+                          'Email +bug +reports +to|' .
+                          '.* +online +help:');
 my $PAT_AUTHOR        = _('Written +by');
 my $PAT_OPTIONS       = _('Options');
 my $PAT_ENVIRONMENT   = _('Environment');
 my $PAT_FILES         = _('Files');
 my $PAT_EXAMPLES      = _('Examples');
 my $PAT_FREE_SOFTWARE = _('This +is +free +software');
+my $PAT_SEE_ALSO      = _('Full +documentation');
 
 # Start a new paragraph (if required) for these.
-s/([^\n])\n($PAT_BUGS|$PAT_AUTHOR) /$1\n\n$2 /og;
+s/([^\n])\n($PAT_BUGS|$PAT_AUTHOR|$PAT_SEE_ALSO) /$1\n\n$2 /og;
 
 # Convert iso-8859-1 copyright symbol or (c) to nroff
 # character.
@@ -462,6 +465,12 @@ while (length)
        $sect = _('AUTHOR');
     }
 
+    elsif (/^($PAT_SEE_ALSO)/o)
+    {
+       $sect = _('SEE ALSO');
+       $opt_no_info = 1;
+    }
+
     # Examples, indicated by an indented leading $, % or > are
     # rendered in a constant width font.
     if (/^( +)([\$\%>] )\S/)
@@ -588,6 +597,17 @@ while (length)
            #   ...
            s/\n([[:upper:]])/\n.br\n$1/g;
        }
+       elsif ($sect eq _('SEE ALSO'))
+       {
+           # Handle external references of the form:
+           #
+           #   GNU <package> online resources: <addr>
+           #   Full documentation at: <addr>
+           #   or available locally via: info ...
+           #
+           s/\'/\\(aq/g;                       # shell quotes for info command
+           s/\n(.)/\n.br\n$1/g;                # separate lines for each item
+       }
     }
 
     # Check if matched paragraph contains /pat/.
index 00180cb02b1a9c5dd788f35173f0bef454ac3bc5..1682b32117ba5e10e481f994cdcfdfbd60fcdb2d 100644 (file)
@@ -567,7 +567,10 @@ Otherwise, units default to 1024 bytes (or 512 if POSIXLY_CORRECT is set).\n\
 static inline void
 emit_ancillary_info (void)
 {
+  char const * program = last_component (program_name);
+
   printf (_("\n%s online help: <%s>\n"), PACKAGE_NAME, PACKAGE_URL);
+
   /* Don't output this redundant message for English locales.
      Note we still output for 'C' so that it gets included in the man page.  */
   const char *lc_messages = setlocale (LC_MESSAGES, NULL);
@@ -578,12 +581,12 @@ emit_ancillary_info (void)
          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));
+                "<http://translationproject.org/team/>\n"), program);
     }
-  printf (_("For complete documentation, run: "
-            "info '(coreutils) %s invocation'\n"),
-          last_component (program_name));
+  printf (_("Full documentation at: <%s%s>\n"),
+          PACKAGE_URL, program);
+  printf (_("or available locally via: info '(coreutils) %s invocation'\n"),
+          program);
 }
 
 static inline void