From d5fec6b512c1d588a5a3dee27226b870a3fe3363 Mon Sep 17 00:00:00 2001 From: Oliver Kiddle Date: Mon, 12 Nov 2018 10:32:41 +0100 Subject: 43816: various completion option updates --- Completion/BSD/Command/_vmctl | 59 ++++++++++++++++++++++++++++++------------- 1 file changed, 41 insertions(+), 18 deletions(-) (limited to 'Completion/BSD') diff --git a/Completion/BSD/Command/_vmctl b/Completion/BSD/Command/_vmctl index 4e66c2383..66d9081b0 100644 --- a/Completion/BSD/Command/_vmctl +++ b/Completion/BSD/Command/_vmctl @@ -1,16 +1,18 @@ #compdef vmctl -local context line state state_descr -local -a subcommands vmctl_status -local -A opt_args +local -a subcommands alts -_vm_name() { - compadd "$@" - ${${${(@f)"$(_call_program vmctl_status vmctl status)"}[2,-1]}##* } +_vm_names() { + local expl + _description virtual-machines expl 'virtual machine' + compadd "$@" "$expl[@]" - ${${${(@f)"$(_call_program virtual-machines vmctl status)"}[2,-1]}##* } } -_vm_switch() { +_vm_switches() { + local expl + _description virtual-switches expl 'virtual switch' [[ -r /etc/vm.conf ]] && - compadd "$@" - ${${${(M)${(f)"$(