feat: add completion script for zsh
All checks were successful
continuous-integration/drone/push Build is passing
All checks were successful
continuous-integration/drone/push Build is passing
This commit is contained in:
parent
b3422db063
commit
d8eb38dd16
1 changed files with 40 additions and 0 deletions
40
misc/igmpgen_completion.zsh
Normal file
40
misc/igmpgen_completion.zsh
Normal file
|
@ -0,0 +1,40 @@
|
||||||
|
#compdef igmpgen
|
||||||
|
|
||||||
|
# Function to handle autocompletion for igmpgen
|
||||||
|
_igmpgen() {
|
||||||
|
local -a options
|
||||||
|
local -a igmp_types
|
||||||
|
|
||||||
|
# Options for igmpgen
|
||||||
|
options=(
|
||||||
|
'-i[Specify the network interface (e.g., eth0)]'
|
||||||
|
'-t[Specify the IGMP packet type and version (e.g., 1.query)]'
|
||||||
|
'-g[Specify the IGMP group (e.g., 224.0.0.1)]'
|
||||||
|
'-s[Specify the source IP and port (e.g., 192.168.1.1:1234)]'
|
||||||
|
'-d[Specify the destination IP and port (e.g., 224.0.0.2:5678)]'
|
||||||
|
'-n[Specify delay between packets in seconds]'
|
||||||
|
)
|
||||||
|
|
||||||
|
# Available IGMP packet types
|
||||||
|
igmp_types=(
|
||||||
|
'1.query'
|
||||||
|
'1.report'
|
||||||
|
'1.dvmrp'
|
||||||
|
'2.query'
|
||||||
|
'2.report'
|
||||||
|
'2.leave'
|
||||||
|
'3.report'
|
||||||
|
)
|
||||||
|
|
||||||
|
_arguments -s $options && return
|
||||||
|
|
||||||
|
case $words[1] in
|
||||||
|
-t)
|
||||||
|
_describe -t igmp-types 'IGMP packet type' igmp_types
|
||||||
|
return
|
||||||
|
;;
|
||||||
|
esac
|
||||||
|
}
|
||||||
|
|
||||||
|
_igmpgen
|
||||||
|
|
Loading…
Reference in a new issue