aboutsummaryrefslogtreecommitdiffstats
path: root/src/_virtualbox
diff options
context:
space:
mode:
authorShohei YOSHIDA <syohex@gmail.com>2022-12-25 13:17:38 +0900
committerShohei YOSHIDA <syohex@gmail.com>2022-12-25 13:17:38 +0900
commit2df4d30003e9b0009ea011cb80d321ef6dd128ac (patch)
tree2844fbe1f729da084867f0abc9f381f639f582c8 /src/_virtualbox
parentReduce functions (diff)
downloadzsh-completions-2df4d30003e9b0009ea011cb80d321ef6dd128ac.tar
zsh-completions-2df4d30003e9b0009ea011cb80d321ef6dd128ac.tar.gz
zsh-completions-2df4d30003e9b0009ea011cb80d321ef6dd128ac.tar.bz2
zsh-completions-2df4d30003e9b0009ea011cb80d321ef6dd128ac.tar.lz
zsh-completions-2df4d30003e9b0009ea011cb80d321ef6dd128ac.tar.xz
zsh-completions-2df4d30003e9b0009ea011cb80d321ef6dd128ac.tar.zst
zsh-completions-2df4d30003e9b0009ea011cb80d321ef6dd128ac.zip
Add dhcpserver subcommand completion
Diffstat (limited to 'src/_virtualbox')
-rw-r--r--src/_virtualbox71
1 files changed, 70 insertions, 1 deletions
diff --git a/src/_virtualbox b/src/_virtualbox
index a37bf8f..72155c2 100644
--- a/src/_virtualbox
+++ b/src/_virtualbox
@@ -318,7 +318,7 @@ _vboxmanage() {
_vboxmanage_hostonlynet && ret=0
;;
(dhcpserver)
- # TODO
+ _vboxmanage_dhcpserver && ret=0
;;
(usbdevsource)
_vboxmanage_usbdevsource && ret=0
@@ -1338,6 +1338,75 @@ _vboxmanage_hostonlynet() {
return $ret
}
+(( $+functions[_vboxmanage_dhcpserver] )) ||
+_vboxmanage_dhcpserver() {
+ local ret=1
+
+ _arguments -C \
+ '1: :(add modify remove start restart stop findlease)' \
+ '*:: :->arg' \
+ && ret=0
+
+ case $state in
+ (arg)
+ case $words[1] in
+ (add|modify)
+ _arguments \
+ '--network=[The internal network name]:name' \
+ '--interface=[The host only interface name]:interface' \
+ '--server-ip=[The IP address the DHCP server should use]:server_ip' \
+ '--lower-ip-address=[The lower IP address range for the DHCP server to manage]:lower' \
+ '--upper-ip-address=[The upper IP address range for the DHCP server to manage]:upper' \
+ '--netmask=[The network mask]:netmask' \
+ '(--enable --disable)--enable[Enable the DHCP server]' \
+ '(--enable --disable)--disable[Disable the DHCP server]' \
+ '--global[Set the configuration scope to global]' \
+ '--vm=[Set the configuration scope to the first NIC of the specified VM]:_vboxmachines' \
+ '--nic=[Set the configuration scope to a NIC]:id' \
+ '--mac-address=[Set the configuration scope to the specified MAC address]:mac' \
+ '--group=[Set the configuration scope to the specified group]:group' \
+ '--set-opt=[Adds the specified DHCP option number (0-255) and value]:option' \
+ '--set-opt-hex=[Adds the specified DHCP option number (0-255) and value]:hex' \
+ '--force-opt=[Forces the specified DHCP option number (0-255)]:opt' \
+ '--suppress-opt=[Prevents the specified DHCP option number (0-255)]:opt' \
+ '--min-lease-time=[Sets the minimum lease time for the current scope in seconds]:sec' \
+ '--default-lease-time=[Sets the default lease time for the current scope in seconds]:sec' \
+ '--max-lease-time=[Sets the maximum lease time for the current scope in seconds]:sec' \
+ '--fixed-address=[Fixed address assignment for a --vm or --mac-address configuration scope]:address' \
+ '--incl-mac=[Include the specific MAC address in the group]:mac' \
+ '--excl-mac=[Exclude the specific MAC address from the group]:mac' \
+ '--incl-mac-wild=[Include the specific MAC address pattern in the group]:pattern' \
+ '--excl-mac-wild=[Exclude the specific MAC address pattern from the group]:pattern' \
+ '--incl-vendor=[Include the specific vendor class ID in the group]:vendor' \
+ '--excl-vendor=[Exclude the specific vendor class ID from the group]:vendor' \
+ '--incl-vendor-wild=[Include the specific vendor class ID pattern in the group]:pattern' \
+ '--excl-vendor-wild=[Exclude the specific vendor class ID pattern from the group]:pattern' \
+ '--incl-user=[Include the specific user class ID in the group]:user' \
+ '--excl-user=[Exclude the specific user class ID from the group]:user' \
+ '--incl-user-wild=[Include the specific user class ID pattern in the group]:pattern' \
+ '--excl-user-wild=[Exclude the specific user class ID pattern from the group]:pattern' \
+ && ret=0
+ ;;
+ (remove|start|restart|stop)
+ _arguments \
+ '--network=[The internal network name]:name' \
+ '--interface=[The host only interface name]:interface' \
+ && ret=0
+ ;;
+ (findlease)
+ _arguments \
+ '--network=[The internal network name]:name' \
+ '--interface=[The host only interface name]:interface' \
+ '--mac-address=[The MAC address to lookup in the lease database]:mac' \
+ && ret=0
+ ;;
+ esac
+ ;;
+ esac
+
+ return $ret
+}
+
(( $+functions[_vboxmanage_usbdevsource] )) ||
_vboxmanage_usbdevsource() {
local ret=1