mirror of
https://gitlab.com/libvirt/libvirt.git
synced 2024-12-22 13:45:38 +00:00
vshCmddefCheckInternals: Fix listing of missing completers for 'VSH_OT_ARGV'
Use a switch statement to cover all cases and check for missing completers for arguments declared as VSH_OT_ARGV. Signed-off-by: Peter Krempa <pkrempa@redhat.com> Reviewed-by: Ján Tomko <jtomko@redhat.com>
This commit is contained in:
parent
7abb44f5f7
commit
3b0b43b485
20
tools/vsh.c
20
tools/vsh.c
@ -324,10 +324,24 @@ vshCmddefCheckInternals(vshControl *ctl,
|
|||||||
return -1; /* too many options */
|
return -1; /* too many options */
|
||||||
}
|
}
|
||||||
|
|
||||||
if (missingCompleters &&
|
if (missingCompleters && !opt->completer) {
|
||||||
(opt->type == VSH_OT_STRING || opt->type == VSH_OT_DATA) &&
|
switch (opt->type) {
|
||||||
!opt->completer)
|
case VSH_OT_STRING:
|
||||||
|
case VSH_OT_DATA:
|
||||||
|
case VSH_OT_ARGV:
|
||||||
virBufferStrcat(&complbuf, opt->name, ", ", NULL);
|
virBufferStrcat(&complbuf, opt->name, ", ", NULL);
|
||||||
|
break;
|
||||||
|
|
||||||
|
case VSH_OT_BOOL:
|
||||||
|
/* only name is completed */
|
||||||
|
case VSH_OT_INT:
|
||||||
|
/* no point in completing numbers */
|
||||||
|
case VSH_OT_ALIAS:
|
||||||
|
/* alias is handled in the referenced command */
|
||||||
|
case VSH_OT_NONE:
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
switch (opt->type) {
|
switch (opt->type) {
|
||||||
case VSH_OT_NONE:
|
case VSH_OT_NONE:
|
||||||
|
Loading…
Reference in New Issue
Block a user