提交 0d1c1a74 编写于 作者: L Lin Ma 提交者: Michal Privoznik

vshReadlineParse: Ignore vshReadlineOptionsGenerator for VSH_OT_ARGV options

Currently the VSH_OT_ARGV options don't support complete, But some of
VSH_OT_ARGV options are gonna support complete in upcoming patches.

Once applied the upcoming completion patches for VSH_OT_ARGV options, If
we don't ignore VSH_OT_ARGV here, The vshReadlineOptionsGenerator will
be called, Hence complete output will consist of the result by command
completer + the result by option completer, It's confusing.
e.g.
    $ virsh domstats --domain <TAB><TAB>
    --backing     --interface      --list-paused      --perf      --vcpu
    --balloon     leap42.3         --list-persistent  --raw       win10
    --block       --list-active    --list-running     sles12sp3
    --cpu-total   --list-inactive  --list-shutoff     sles15
    --enforce     --list-other     --list-transient   --state

After this patch and the upcoming completion patches:
    $ virsh domstats --domain <TAB><TAB>
    leap42.3    sles12sp3    sles15    win10
Signed-off-by: NLin Ma <lma@suse.com>
上级 ee6113aa
......@@ -2824,7 +2824,9 @@ vshReadlineParse(const char *text, int state)
if (!cmd) {
list = vshReadlineCommandGenerator(text);
} else {
if (!opt || (opt->type != VSH_OT_DATA && opt->type != VSH_OT_STRING))
if (!opt || (opt->type != VSH_OT_DATA &&
opt->type != VSH_OT_STRING &&
opt->type != VSH_OT_ARGV))
list = vshReadlineOptionsGenerator(text, cmd, partial);
if (opt && opt->completer) {
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册