summaryrefslogtreecommitdiff
path: root/Completion/BSD/Command
diff options
context:
space:
mode:
authorOliver Kiddle <okiddle@yahoo.co.uk>2019-10-18 22:47:32 +0200
committerOliver Kiddle <okiddle@yahoo.co.uk>2019-10-18 22:47:32 +0200
commita891557b4971afa480c2108d88685b650a3dac13 (patch)
tree11da28bbcc53f3fc4b4991a9fd526eca16120929 /Completion/BSD/Command
parent59901e61cb3e7c8c36bb77c722102e2b9504dc5c (diff)
downloadzsh-a891557b4971afa480c2108d88685b650a3dac13.tar.gz
zsh-a891557b4971afa480c2108d88685b650a3dac13.zip
44849: completion updates for changes in OpenBSD 6.6
Diffstat (limited to 'Completion/BSD/Command')
-rw-r--r--Completion/BSD/Command/_vmctl63
1 files changed, 25 insertions, 38 deletions
diff --git a/Completion/BSD/Command/_vmctl b/Completion/BSD/Command/_vmctl
index d22657310..873bb5670 100644
--- a/Completion/BSD/Command/_vmctl
+++ b/Completion/BSD/Command/_vmctl
@@ -42,18 +42,14 @@ else
_vm_names
;;
create)
- if (( CURRENT == 2 )); then
- compset -P '(raw|qcow2):' || alts=(
- 'prefixes:prefix:compadd -S: raw qcow2'
- )
- _alternative 'files:path:_files' $alts
- else
- shift words; (( CURRENT-- ))
- _arguments \
- '-s+[specify size]:size' \
- '(-i)-b+[specify base disk]:base image:_files'
- '(-b)-i+[copy and convert input disk]:disk image:_files'
- fi
+ compset -P '(raw|qcow2):' || alts=(
+ 'prefixes:prefix:compadd -S: raw qcow2'
+ )
+ _arguments \
+ '-s+[specify size]:size' \
+ '(-i)-b+[specify base disk]:base image:_files' \
+ '(-b)-i+[copy and convert input disk]:disk image:_files' \
+ '1:disk: _alternative "files:path:_files" $alts'
;;
load)
_arguments ':configuration file:_files'
@@ -72,34 +68,25 @@ else
))'
;;
start)
- if (( CURRENT == 2 )); then
- _vm_names
- else
- shift words; (( CURRENT-- ))
- _arguments -s \
- '-B+[force system to boot from specified device for this boot]:device:(cdrom disk net)' \
- '-b+[boot with the specified kernel or BIOS image]:boot image:_files' \
- '-c[automatically connect to the VM console]' \
- '*-d+[disk image file]:disk image:_files' \
- '-i+[number of network interfaces]:number: ' \
- '-L[add a local network interface]' \
- '-m+[specify memory size]:memory size (megabytes) [512]' \
- '-n+[specify switch to attach]: :_vm_switches' \
- '-r+[specify ISO image file for virtual CD-ROM]:ISO image:_files -g "*.iso(-.)"' \
- '-t+[use existing VM as a template]: :_vm_names'
- fi
+ _arguments -s \
+ '-B+[force system to boot from specified device for this boot]:device:(cdrom disk net)' \
+ '-b+[boot with the specified kernel or BIOS image]:boot image:_files' \
+ '-c[automatically connect to the VM console]' \
+ '*-d+[disk image file]:disk image:_files' \
+ '-i+[number of network interfaces]:number: ' \
+ '-L[add a local network interface]' \
+ '-m+[specify memory size]:memory size (megabytes) [512]' \
+ '-n+[specify switch to attach]: :_vm_switches' \
+ '-r+[specify ISO image file for virtual CD-ROM]:ISO image:_files -g "*.iso(-.)"' \
+ '-t+[use existing VM as a template]: :_vm_names' \
+ '1: :_vm_names'
;;
stop)
- if (( CURRENT == 2 )); then
- _alternative \
- 'all:all:(-a)' \
- 'virtual-machines: :_vm_names'
- else
- shift words; (( CURRENT-- ))
- _arguments \
- '-f[forcefully stop without attempting a graceful shutdown]' \
- '-w[wait until the VM has been terminated]'
- fi
+ _arguments \
+ '(1)-a[stop all running VMs]' \
+ '-f[forcefully stop without attempting a graceful shutdown]' \
+ '-w[wait until the VM has been terminated]' \
+ '(-a)1: :_vm_names'
;;
*)
_default