[libvirt] [PATCH 06/17] vshReadlineParse: Ignore vshReadlineOptionsGenerator for VSH_OT_INT options

Lin Ma morecache at gmail.com
Fri Sep 11 07:13:07 UTC 2020


Commit c7151b0 added the completion for VSH_OT_INT options, say '--cellno'
and '--pagesize', So we need to ignore VSH_OT_INT otherwise we get the
incorrect completion.

before:
 # virsh freepages --pagesize <TAB><TAB>
--all     --cellno  1GiB      2MiB      4KiB

after:
 # virsh freepages --pagesize <TAB><TAB>
1GiB  2MiB  4KiB

Signed-off-by: Lin Ma <lma at suse.de>
---
 tools/vsh.c | 1 +
 1 file changed, 1 insertion(+)

diff --git a/tools/vsh.c b/tools/vsh.c
index 0e8edcd78c..8b50e20a5a 100644
--- a/tools/vsh.c
+++ b/tools/vsh.c
@@ -2780,6 +2780,7 @@ vshReadlineParse(const char *text, int state)
         } else {
             if (!opt || (opt->type != VSH_OT_DATA &&
                          opt->type != VSH_OT_STRING &&
+                         opt->type != VSH_OT_INT &&
                          opt->type != VSH_OT_ARGV))
                 list = vshReadlineOptionsGenerator(text, cmd, partial);
 
-- 
2.26.0




More information about the libvir-list mailing list