]> sourceware.org Git - glibc.git/commitdiff
nscd: list all tables in usage()
authorSami Kerola <kerolasa@iki.fi>
Fri, 3 Jan 2014 21:00:56 +0000 (21:00 +0000)
committerMike Frysinger <vapier@gentoo.org>
Sat, 4 Jan 2014 13:44:36 +0000 (08:44 -0500)
Usage output for option --invalidate=TABLE is not helpful without
list of tables.  The list is also missing from nscd(8) manual which
made it pretty difficult to know what are the tables.

ChangeLog
nscd/nscd.c

index ddfb69a2fd63cae3b8f8827696157d7ef79e2037..2acd69d9832e2ae55ac1e0979fa885d0a42eb8b6 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,7 @@
+2014-01-04  Sami Kerola  <kerolasa@iki.fi>
+
+       * nscd/nscd.c: Improve usage() output.
+
 2014-01-04  Mike Frysinger  <vapier@gentoo.org>
 
        * config.h.in: Add HAVE_LINUX_FANOTIFY_H template.
index e7f04f808c3890a068fca9f215590db4d6f7a911..63d9d8359936b79ec3738447b5d894987614468d 100644 (file)
@@ -442,19 +442,38 @@ parse_opt (int key, char *arg, struct argp_state *state)
 static char *
 more_help (int key, const char *text, void *input)
 {
-  char *tp = NULL;
+  char *tables, *tp = NULL;
+
   switch (key)
     {
     case ARGP_KEY_HELP_EXTRA:
+      {
+       dbtype cnt;
+
+       tables = xmalloc (sizeof (dbnames) + 1);
+       for (cnt = 0; cnt < lastdb; cnt++)
+         {
+           strcat (tables, dbnames[cnt]);
+           strcat (tables, " ");
+         }
+      }
+
       /* We print some extra information.  */
       if (asprintf (&tp, gettext ("\
+Supported tables:\n\
+%s\n\
+\n\
 For bug reporting instructions, please see:\n\
-%s.\n"), REPORT_BUGS_TO) < 0)
-       return NULL;
+%s.\n\
+"), tables, REPORT_BUGS_TO) < 0)
+       tp = NULL;
+      free (tables);
       return tp;
+
     default:
       break;
     }
+
   return (char *) text;
 }
 
This page took 0.127455 seconds and 5 git commands to generate.