aboutsummaryrefslogtreecommitdiffstats
path: root/src/_virtualbox
diff options
context:
space:
mode:
authorShohei YOSHIDA <syohex@gmail.com>2022-12-25 12:56:22 +0900
committerShohei YOSHIDA <syohex@gmail.com>2022-12-25 12:56:22 +0900
commit337c43064e5cbd4496a00f5f805106ae19fd4c83 (patch)
tree6d379717fb1fac127228bc3ca44bbb018bcba83e /src/_virtualbox
parentAdd metrics subcommand completion (diff)
downloadzsh-completions-337c43064e5cbd4496a00f5f805106ae19fd4c83.tar
zsh-completions-337c43064e5cbd4496a00f5f805106ae19fd4c83.tar.gz
zsh-completions-337c43064e5cbd4496a00f5f805106ae19fd4c83.tar.bz2
zsh-completions-337c43064e5cbd4496a00f5f805106ae19fd4c83.tar.lz
zsh-completions-337c43064e5cbd4496a00f5f805106ae19fd4c83.tar.xz
zsh-completions-337c43064e5cbd4496a00f5f805106ae19fd4c83.tar.zst
zsh-completions-337c43064e5cbd4496a00f5f805106ae19fd4c83.zip
Add hostonlyif subcommand completion
Diffstat (limited to 'src/_virtualbox')
-rw-r--r--src/_virtualbox30
1 files changed, 29 insertions, 1 deletions
diff --git a/src/_virtualbox b/src/_virtualbox
index 13c13d1..b2cf393 100644
--- a/src/_virtualbox
+++ b/src/_virtualbox
@@ -312,7 +312,7 @@ _vboxmanage() {
_vboxmanage_natnetwork && ret=0
;;
(hostonlyif)
- # TODO
+ _vboxmanage_hostonlyif && ret=0
;;
(hostonlynet)
# TODO
@@ -1290,6 +1290,34 @@ _vboxmanage_natnetwork() {
return $ret
}
+(( $+functions[_vboxmanage_hostonlyif] )) ||
+_vboxmanage_hostonlyif() {
+ local ret=1
+
+ _arguments -C \
+ '1: :(ipconfig create remove)' \
+ '*:: :->arg' \
+ && ret=0
+
+ case $state in
+ (arg)
+ case $words[1] in
+ (ipconfig)
+ _arguments \
+ '--dhcp[Uses DHCP for the network interface]' \
+ '--ip=[Specifies the IPv4 IP address for the network interface]:ipv4' \
+ '--netmask=[Specifies the IPv4 netmask of the network interface]:v4mask' \
+ '--ipv6=[Specifies the IPv6 IP address for the network interface]:ipv6' \
+ '--netmasklengthv6=[Specifies the length of the IPv6 network interface]:length' \
+ && ret=0
+ ;;
+ esac
+ ;;
+ esac
+
+ return $ret
+}
+
(( $+functions[_vboxmanage_usbdevsource] )) ||
_vboxmanage_usbdevsource() {
local ret=1