]> git.ipfire.org Git - thirdparty/grub.git/commitdiff
* normal/completion.c (grub_normal_do_completion): When completing
authorColin Watson <cjwatson@ubuntu.com>
Mon, 7 Jun 2010 21:13:26 +0000 (22:13 +0100)
committerColin Watson <cjwatson@ubuntu.com>
Mon, 7 Jun 2010 21:13:26 +0000 (22:13 +0100)
arguments to "set" and the current word contains an equals sign,
skip to after the equals sign before starting completion.

ChangeLog
normal/completion.c

index b8f5f80d8981bff09899ec8b62efe3c96f8dd478..bc1b2686ae8a89cdb588a1e348ad8053239456d1 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,9 @@
+2010-06-07  Colin Watson  <cjwatson@ubuntu.com>
+
+       * normal/completion.c (grub_normal_do_completion): When completing
+       arguments to "set" and the current word contains an equals sign,
+       skip to after the equals sign before starting completion.
+
 2010-06-07  Colin Watson  <cjwatson@ubuntu.com>
 
        * fs/i386/pc/pxe.c (grub_pxe_open): Fix parsing of gateway_ip.
index 13e8f7a6bd1c90b0347cde164b545b3b8a957e14..334eaea1135d3eed22e065ca9cbccf660046bebc 100644 (file)
@@ -414,6 +414,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);