vshReadlineParse: Ignore vshReadlineOptionsGenerator for VSH_OT_INT options

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>
This commit is contained in:
Lin Ma 2020-09-11 15:13:07 +08:00 committed by Michal Privoznik
parent eddd9932ee
commit d9a320bf97

View 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);