# bash completion for tcpdump                              -*- shell-script -*-

_tcpdump()
{
    local cur prev words cword
    _init_completion || return

    case $prev in
        -r|-w|-F)
            _filedir
            return
            ;;
        -i)
            _available_interfaces -a
            return
            ;;
        -m)
            _filedir mib
            return
            ;;
        -T)
            COMPREPLY=( $( compgen -W 'aodv cnfp rpc rtp rtcp snmp tftp vat
                wb' -- "$cur" ) )
            return
            ;;
        -z)
            compopt -o filenames
            COMPREPLY=( $( compgen -c -- "$cur" ) )
            return
            ;;
        -Z)
            _allowed_users
            return
            ;;
        -B|-c|-C|-D|-E|-G|-M|-s|-W|-y)
            return
            ;;
    esac

    if [[ "$cur" == -* ]]; then
        COMPREPLY=( $( compgen -W '$( _parse_usage "$1" )' -- "$cur" ) )
    fi

} &&
complete -F _tcpdump tcpdump

# ex: filetype=sh
