]>
git.ipfire.org Git - thirdparty/xfsprogs-dev.git/blob - db/help.c
2 * Copyright (c) 2000-2001,2005 Silicon Graphics, Inc.
5 * This program is free software; you can redistribute it and/or
6 * modify it under the terms of the GNU General Public License as
7 * published by the Free Software Foundation.
9 * This program is distributed in the hope that it would be useful,
10 * but WITHOUT ANY WARRANTY; without even the implied warranty of
11 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12 * GNU General Public License for more details.
14 * You should have received a copy of the GNU General Public License
15 * along with this program; if not, write the Free Software Foundation,
16 * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
24 static void help_all(void);
25 static void help_onecmd(const char *cmd
, const cmdinfo_t
*ct
);
26 static int help_f(int argc
, char **argv
);
27 static void help_oneline(const char *cmd
, const cmdinfo_t
*ct
);
29 static const cmdinfo_t help_cmd
=
30 { "help", "?", help_f
, 0, 1, 0, N_("[command]"),
31 N_("help for one or all commands"), NULL
};
38 for (ct
= cmdtab
; ct
< &cmdtab
[ncmds
]; ct
++)
39 help_oneline(ct
->name
, ct
);
40 dbprintf(_("\nUse 'help commandname' for extended help.\n"));
54 ct
= find_command(argv
[1]);
56 dbprintf(_("command %s not found\n"), argv
[1]);
59 help_onecmd(argv
[1], ct
);
66 add_command(&help_cmd
);
74 help_oneline(cmd
, ct
);
87 dbprintf("%s ", ct
->name
);
89 dbprintf(_("(or %s) "), ct
->altname
);
92 dbprintf("%s ", ct
->args
);
93 dbprintf("-- %s\n", ct
->oneline
);