]> git.ipfire.org Git - thirdparty/coreutils.git/commitdiff
doc: ensure the correct texinfo nodes are referenced in --help
authorPádraig Brady <P@draigBrady.com>
Thu, 18 Sep 2014 13:37:37 +0000 (14:37 +0100)
committerPádraig Brady <P@draigBrady.com>
Fri, 19 Sep 2014 10:24:05 +0000 (11:24 +0100)
* src/system.h (emit_ancillary_info): For commands that don't have
a 1:1 mapping with the texinfo node names, provide a mapping to
the correct node.
* doc/coreutils.texi: Add some extra cross references noticed while
checking this.
Fixes http://bugs.debian.org/762092

doc/coreutils.texi
src/system.h

index fb083f096137305767b957f58e6bee7bc8f1ac55..1519fcb3e1285ee7eaa88440392baa95426cf1a9 100644 (file)
@@ -4206,7 +4206,8 @@ The commands @command{sha224sum}, @command{sha256sum},
 @command{sha384sum} and @command{sha512sum} compute checksums of
 various lengths (respectively 224, 256, 384 and 512 bits),
 collectively known as the SHA-2 hashes.  The usage and options of
-these commands are precisely the same as for @command{md5sum}.
+these commands are precisely the same as for @command{md5sum}
+and @command{sha1sum}.
 @xref{md5sum invocation}.
 
 Note: The SHA384 and SHA512 digests are considerably slower to
@@ -7961,6 +7962,8 @@ and special characters are represented by backslash escape sequences.
 -b}; that is, by default files are listed in long format and special
 characters are represented by backslash escape sequences.
 
+@xref{ls invocation, @command{ls}}.
+
 @node dircolors invocation
 @section @command{dircolors}: Color setup for @command{ls}
 
index 1682b32117ba5e10e481f994cdcfdfbd60fcdb2d..b5bbec2f3882b998ec5441fdaedc64313f9c4753 100644 (file)
@@ -567,7 +567,26 @@ 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);
+  char const *program = last_component (program_name);
+
+  struct infomap { char const *program; char const *node; } const infomap[] = {
+    { "[", "test invocation" },
+    { "coreutils", "Multi-call invocation" },
+    { "sha224sum", "sha2 utilities" },
+    { "sha256sum", "sha2 utilities" },
+    { "sha384sum", "sha2 utilities" },
+    { "sha512sum", "sha2 utilities" },
+    { NULL, NULL }
+  };
+
+  char const *node = program;
+  struct infomap const *map_prog = infomap;
+
+  while (map_prog->program && ! STREQ (program, map_prog->program))
+    map_prog++;
+
+  if (map_prog->node)
+    node = map_prog->node;
 
   printf (_("\n%s online help: <%s>\n"), PACKAGE_NAME, PACKAGE_URL);
 
@@ -585,8 +604,8 @@ emit_ancillary_info (void)
     }
   printf (_("Full documentation at: <%s%s>\n"),
           PACKAGE_URL, program);
-  printf (_("or available locally via: info '(coreutils) %s invocation'\n"),
-          program);
+  printf (_("or available locally via: info '(coreutils) %s%s'\n"),
+          node, node == program ? " invocation" : "");
 }
 
 static inline void