PageRenderTime 77ms CodeModel.GetById 75ms app.highlight 1ms RepoModel.GetById 1ms app.codeStats 0ms

/bash_completion.d/tcpdump

http://github.com/brinkman83/bashrc
#! | 38 lines | 31 code | 7 blank | 0 comment | 0 complexity | 769a7442e756722c9079e52182803cf8 MD5 | raw file
 1# bash completion for tcpdump
 2
 3have tcpdump &&
 4_tcpdump()
 5{
 6    local cur prev
 7
 8    COMPREPLY=()
 9    cur=`_get_cword`
10    prev=${COMP_WORDS[COMP_CWORD-1]}
11
12    case "$prev" in
13        -@(r|w|F))
14            _filedir
15            return 0
16            ;;
17        -i)
18            _available_interfaces -a
19            return 0
20            ;;
21    esac
22
23
24    if [[ "$cur" == -* ]]; then
25        COMPREPLY=( $( compgen -W '-a -d -e -f -l -n -N -O -p \
26            -q -R -S -t -u -v -x -C -F -i -m -r -s -T -w -E' -- "$cur" ) )
27    fi
28
29} &&
30complete -F _tcpdump tcpdump
31
32# Local variables:
33# mode: shell-script
34# sh-basic-offset: 4
35# sh-indent-comment: t
36# indent-tabs-mode: nil
37# End:
38# ex: ts=4 sw=4 et filetype=sh