48 lines
1.0 KiB
Bash
48 lines
1.0 KiB
Bash
# bash completion for tcpdump -*- shell-script -*-
|
|
|
|
_tcpdump()
|
|
{
|
|
local cur prev words cword
|
|
_init_completion || return
|
|
|
|
case $prev in
|
|
-r|-w|-F)
|
|
_filedir
|
|
return 0
|
|
;;
|
|
-i)
|
|
_available_interfaces -a
|
|
return 0
|
|
;;
|
|
-m)
|
|
_filedir mib
|
|
return 0
|
|
;;
|
|
-T)
|
|
COMPREPLY=( $( compgen -W 'aodv cnfp rpc rtp rtcp snmp tftp vat
|
|
wb' -- "$cur" ) )
|
|
return 0
|
|
;;
|
|
-z)
|
|
compopt -o filenames
|
|
COMPREPLY=( $( compgen -c -- "$cur" ) )
|
|
return 0
|
|
;;
|
|
-Z)
|
|
_allowed_users
|
|
return 0
|
|
;;
|
|
-B|-c|-C|-D|-E|-G|-M|-s|-W|-y)
|
|
return 0
|
|
;;
|
|
esac
|
|
|
|
if [[ "$cur" == -* ]]; then
|
|
COMPREPLY=( $( compgen -W '$( _parse_usage "$1" )' -- "$cur" ) )
|
|
fi
|
|
|
|
} &&
|
|
complete -F _tcpdump tcpdump
|
|
|
|
# ex: ts=4 sw=4 et filetype=sh
|