merge with mainline
This commit is contained in:
commit
297f0c2b6e
218 changed files with 35637 additions and 4957 deletions
|
@ -176,21 +176,6 @@ iterate_dev (const char *devname)
|
|||
return 0;
|
||||
}
|
||||
|
||||
static int
|
||||
iterate_command (grub_command_t cmd)
|
||||
{
|
||||
if (cmd->prio & GRUB_PRIO_LIST_FLAG_ACTIVE)
|
||||
{
|
||||
if (cmd->flags & GRUB_COMMAND_FLAG_CMDLINE)
|
||||
{
|
||||
if (add_completion (cmd->name, " ", GRUB_COMPLETION_TYPE_COMMAND))
|
||||
return 1;
|
||||
}
|
||||
}
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
/* Complete a device. */
|
||||
static int
|
||||
complete_device (void)
|
||||
|
@ -414,6 +399,14 @@ grub_normal_do_completion (char *buf, int *restore,
|
|||
else
|
||||
current_word = argv[argc - 1];
|
||||
|
||||
if (argc > 1 && ! grub_strcmp (argv[0], "set"))
|
||||
{
|
||||
char *equals = grub_strchr (current_word, '=');
|
||||
if (equals)
|
||||
/* Complete the value of the variable. */
|
||||
current_word = equals + 1;
|
||||
}
|
||||
|
||||
/* Determine the state the command line is in, depending on the
|
||||
state, it can be determined how to complete. */
|
||||
cmdline_state = get_state (buf);
|
||||
|
@ -421,8 +414,18 @@ grub_normal_do_completion (char *buf, int *restore,
|
|||
if (argc == 1 || argc == 0)
|
||||
{
|
||||
/* Complete a command. */
|
||||
if (grub_command_iterate (iterate_command))
|
||||
goto fail;
|
||||
grub_command_t cmd;
|
||||
FOR_COMMANDS(cmd)
|
||||
{
|
||||
if (cmd->prio & GRUB_PRIO_LIST_FLAG_ACTIVE)
|
||||
{
|
||||
if (cmd->flags & GRUB_COMMAND_FLAG_CMDLINE)
|
||||
{
|
||||
if (add_completion (cmd->name, " ", GRUB_COMPLETION_TYPE_COMMAND))
|
||||
goto fail;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
else if (*current_word == '-')
|
||||
{
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue