qemu-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Qemu-devel] [PATCH V7 13/13] monitor: improve auto complete of "help" f


From: Wenchao Xia
Subject: [Qemu-devel] [PATCH V7 13/13] monitor: improve auto complete of "help" for single command in sub group
Date: Sat, 20 Jul 2013 09:44:15 +0800

Now special case "help *" in auto completion can work with sub commands,
such as "help info u*".

Signed-off-by: Wenchao Xia <address@hidden>
---
 monitor.c |    6 ++----
 1 files changed, 2 insertions(+), 4 deletions(-)

diff --git a/monitor.c b/monitor.c
index ea3ed96..95fa918 100644
--- a/monitor.c
+++ b/monitor.c
@@ -4314,10 +4314,8 @@ static void monitor_find_completion_by_table(Monitor 
*mon,
                     cmd_completion(mon, str, QKeyCode_lookup[i]);
                 }
             } else if (!strcmp(cmd->name, "help|?")) {
-                readline_set_completion_index(mon->rs, strlen(str));
-                for (cmd = cmd_table; cmd->name != NULL; cmd++) {
-                    cmd_completion(mon, str, cmd->name);
-                }
+                monitor_find_completion_by_table(mon, cmd_table,
+                                                 &args[1], nb_args - 1);
             }
             break;
         default:
-- 
1.7.1





reply via email to

[Prev in Thread] Current Thread [Next in Thread]