better --version in textutils

Andrew D Jewell <[email protected]>
Newsgroups gmane.comp.gnu.textutils.bugs
Message-ID <a0511170ab91acecb0474@[24.29.2.13]>
Something I find useful : adds the glibc version to the "--version" display.
Requires AC_CHECK_HEADERS(gnu/libc-version.h) in configure.ac

adj


--- old-version-etc.c   Wed May 29 11:30:01 2002
+++ version-etc.c       Wed May 29 10:38:07 2002
@@ -32,6 +32,12 @@
  # define _(Text) Text
  #endif

+#ifdef HAVE_GNU_LIBC_VERSION_H
+#include <gnu/libc-version.h>
+#else
+const char * gnu_get_libc_version() {return "not used.";}
+#endif
+
  /* Default copyright goes to the FSF. */

  char* version_etc_copyright =
@@ -55,9 +61,9 @@
              const char *version, const char *authors)
  {
    if (command_name)
-    fprintf (stream, "%s (%s) %s\n", command_name, package, version);
+    fprintf (stream, "%s (%s) %s (glibc %s)\n", command_name, 
package, version, gnu_get_libc_version());
    else
-    fprintf (stream, "%s %s\n", package, version);
+    fprintf (stream, "%s %s (glibc %s)\n", package, version, 
gnu_get_libc_version());
    fprintf (stream, _("Written by %s.\n"), authors);
    putc ('\n', stream);
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.