mirror of
git://sourceware.org/git/glibc.git
synced 2024-11-27 03:41:23 +08:00
nscd: list all tables in usage()
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.
This commit is contained in:
parent
20f4a8d993
commit
0c813d1f3e
@ -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.
|
||||
|
25
nscd/nscd.c
25
nscd/nscd.c
@ -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;
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user