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:
parent
b0c95fd0d4
commit
479bc51947
3 changed files with 25 additions and 7 deletions
|
@ -1,3 +1,8 @@
|
|||
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.
|
||||
|
||||
2002-02-08 Yoshinori K. Okuji <okuji@enbug.org>
|
||||
|
||||
An internal pager is implemented.
|
||||
|
|
5
NEWS
5
NEWS
|
@ -6,12 +6,11 @@ New in 0.92:
|
|||
the notation of data transfers. And, that is displayed only in debug
|
||||
mode, that is to say, nothing is displayed by default. Remember that
|
||||
you can turn on debug mode via the command "debug".
|
||||
* The command "help" doesn't show all the available commands any longer,
|
||||
* The command "help" doesn't show all the available commands by default,
|
||||
when no argument is specified. Rarely used commands (such as
|
||||
"testload") and useless commands in interactive use (such as
|
||||
"savedefault") are hidden. If you want to see help messages for those
|
||||
commands, you will have to specify the names to "help" explicitly.
|
||||
(Also, note that <TAB> still shows all the commands.)
|
||||
commands, specify the new option "--all".
|
||||
* A built-in, `more'-like pager is added. When a command prints too many
|
||||
lines to fit the screen, GRUB waits until you hit return key. This
|
||||
feature can be turned off by the new command "pager".
|
||||
|
|
|
@ -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'."
|
||||
};
|
||||
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue