mirror of
https://git.savannah.gnu.org/git/grub.git
synced 2026-10-27 01:29:27 +00:00
2002-02-08 Yoshinori K. Okuji <okuji@enbug.org>
* stage2/builtins.c (help_func): Show all the commands runnable with the command-line interface, if "--all" is specified.
This commit is contained in:
1 parent
b0c95fd0d4
commit
479bc51947
3 files changed
+25
-7
No files matched your search
+18
-4
@@ -1396,6 +1396,14 @@ static struct builtin builtin_halt =
|
||||
static int
|
||||
help_func (char *arg, int flags)
|
||||
{
|
||||
int all = 0;
|
||||
|
||||
if (grub_memcmp (arg, "--all", sizeof ("--all") - 1) == 0)
|
||||
{
|
||||
all = 1;
|
||||
arg = skip_to (0, arg);
|
||||
}
|
||||
|
||||
if (! *arg)
|
||||
{
|
||||
/* Invoked with no argument. Print the list of the short docs. */
|
||||
@@ -1407,9 +1415,14 @@ help_func (char *arg, int flags)
|
||||
int len;
|
||||
int i;
|
||||
|
||||
/* If this doesn't need to be listed automatically,
|
||||
/* If this cannot be used in the command-line interface,
|
||||
skip this. */
|
||||
if (! ((*builtin)->flags & BUILTIN_HELP_LIST))
|
||||
if (! ((*builtin)->flags & BUILTIN_CMDLINE))
|
||||
continue;
|
||||
|
||||
/* If this doesn't need to be listed automatically and "--all"
|
||||
is not specified, skip this. */
|
||||
if (! all && ! ((*builtin)->flags & BUILTIN_HELP_LIST))
|
||||
continue;
|
||||
|
||||
len = grub_strlen ((*builtin)->short_doc);
|
||||
@@ -1498,8 +1511,9 @@ static struct builtin builtin_help =
|
||||
"help",
|
||||
help_func,
|
||||
BUILTIN_CMDLINE | BUILTIN_HELP_LIST,
|
||||
"help [PATTERN ...]",
|
||||
"Display helpful information about builtin commands."
|
||||
"help [--all] [PATTERN ...]",
|
||||
"Display helpful information about builtin commands. Not all commands"
|
||||
" aren't shown without the option `--all'."
|
||||
};
|
||||
|
||||
|
||||
|
||||
Reference in new issue
Block a user