]> git.ipfire.org Git - thirdparty/libvirt.git/commitdiff
vshReadlineParse: Ignore vshReadlineOptionsGenerator for VSH_OT_INT options
authorLin Ma <morecache@gmail.com>
Fri, 11 Sep 2020 07:13:07 +0000 (15:13 +0800)
committerMichal Privoznik <mprivozn@redhat.com>
Mon, 14 Sep 2020 13:52:40 +0000 (15:52 +0200)
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@suse.de>
Reviewed-by: Michal Privoznik <mprivozn@redhat.com>
tools/vsh.c

index e3c2404a7430ebcadddef0554493b82156fe5a14..87c409e4aa3db14eaa91c68a761dc619eb313cf8 100644 (file)
@@ -2778,6 +2778,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);