2011-11-01 22:14:45 +02:00
|
|
|
# bash completion for tcpdump -*- shell-script -*-
|
2009-05-27 18:58:31 +02:00
|
|
|
|
|
|
|
_tcpdump()
|
|
|
|
{
|
2011-04-21 11:04:51 +03:00
|
|
|
local cur prev words cword
|
|
|
|
_init_completion || return
|
2009-05-27 18:58:31 +02:00
|
|
|
|
2009-12-30 00:39:59 +01:00
|
|
|
case $prev in
|
2009-11-22 11:43:26 +01:00
|
|
|
-r|-w|-F)
|
2009-10-04 19:42:50 +02:00
|
|
|
_filedir
|
|
|
|
return 0
|
|
|
|
;;
|
|
|
|
-i)
|
|
|
|
_available_interfaces -a
|
|
|
|
return 0
|
|
|
|
;;
|
2011-05-05 00:18:18 +03:00
|
|
|
-m)
|
|
|
|
_filedir mib
|
|
|
|
return 0
|
|
|
|
;;
|
|
|
|
-T)
|
|
|
|
COMPREPLY=( $( compgen -W 'aodv cnfp rpc rtp rtcp snmp tftp vat
|
|
|
|
wb' -- "$cur" ) )
|
|
|
|
return 0
|
|
|
|
;;
|
|
|
|
-z)
|
2012-11-06 23:02:41 +02:00
|
|
|
compopt -o filenames
|
2011-05-05 00:18:18 +03:00
|
|
|
COMPREPLY=( $( compgen -c -- "$cur" ) )
|
|
|
|
return 0
|
|
|
|
;;
|
|
|
|
-Z)
|
|
|
|
_allowed_users
|
|
|
|
return 0
|
|
|
|
;;
|
|
|
|
-B|-c|-C|-D|-E|-G|-M|-s|-W|-y)
|
|
|
|
return 0
|
|
|
|
;;
|
2009-10-04 19:42:50 +02:00
|
|
|
esac
|
2009-05-27 18:58:31 +02:00
|
|
|
|
2009-10-04 19:42:50 +02:00
|
|
|
if [[ "$cur" == -* ]]; then
|
2011-05-05 00:18:18 +03:00
|
|
|
COMPREPLY=( $( compgen -W '$( _parse_usage "$1" )' -- "$cur" ) )
|
2009-10-04 19:42:50 +02:00
|
|
|
fi
|
2009-05-27 18:58:31 +02:00
|
|
|
|
|
|
|
} &&
|
|
|
|
complete -F _tcpdump tcpdump
|
2009-10-01 20:54:51 +03:00
|
|
|
|
2009-10-04 19:42:50 +02:00
|
|
|
# ex: ts=4 sw=4 et filetype=sh
|