PageRenderTime 71ms CodeModel.GetById 66ms app.highlight 2ms RepoModel.GetById 2ms app.codeStats 0ms

/bash_completion.d/dsniff

http://github.com/brinkman83/bashrc
#! | 287 lines | 232 code | 55 blank | 0 comment | 0 complexity | e5acfc6988dd0ed9d3586fa9cc06f97e MD5 | raw file
  1# dsniff util completion by Guillaume Rousse <rousse@ccr.jussieu.fr>
  2
  3# arpspoof(8) completion
  4#
  5have arpspoof &&
  6_arpspoof()
  7{
  8    local cur prev
  9
 10    COMPREPLY=()
 11    cur=`_get_cword`
 12    prev=${COMP_WORDS[COMP_CWORD-1]}
 13
 14    case "$prev" in
 15        -i)
 16            _interfaces
 17            return 0
 18            ;;
 19        -t)
 20            _known_hosts_real "$cur"
 21            return 0
 22            ;;
 23    esac
 24
 25    if [[ "$cur" == -* ]]; then
 26        COMPREPLY=( $( compgen -W '-i -t' -- "$cur" ) )
 27    else
 28        _known_hosts_real "$cur"
 29    fi
 30
 31} &&
 32complete -F _arpspoof arpspoof
 33
 34# dnsspoof(8) completion
 35#
 36have dnsspoof &&
 37_dnsspoof()
 38{
 39    local cur prev
 40
 41    COMPREPLY=()
 42    cur=`_get_cword`
 43    prev=${COMP_WORDS[COMP_CWORD-1]}
 44
 45    case "$prev" in
 46        -i)
 47            _interfaces
 48            return 0
 49            ;;
 50        -f)
 51            _filedir
 52            return 0
 53            ;;
 54    esac
 55
 56    if [[ "$cur" == -* ]]; then
 57        COMPREPLY=( $( compgen -W '-i -f' -- "$cur" ) )
 58    fi
 59
 60} &&
 61complete -F _dnsspoof dnsspoof
 62
 63# dsniff(8) completion
 64#
 65have dsniff &&
 66_dsniff()
 67{
 68    local cur prev
 69
 70    COMPREPLY=()
 71    cur=`_get_cword`
 72    prev=${COMP_WORDS[COMP_CWORD-1]}
 73
 74    case "$prev" in
 75        -@(r|w|f))
 76            _filedir
 77            return 0
 78            ;;
 79        -i)
 80            _interfaces
 81            return 0
 82            ;;
 83    esac
 84
 85    if [[ "$cur" == -* ]]; then
 86        COMPREPLY=( $( compgen -W '-c -d -m -n -i -s -f -t -r -w' -- "$cur" ) )
 87    fi
 88
 89} &&
 90complete -F _dsniff dsniff
 91
 92# filesnarf(8), mailsnarf(8) and msgsnarf (8) completion
 93#
 94have filesnarf || have mailsnarf || have msgsnarf &&
 95_snarf()
 96{
 97    local cur prev
 98
 99    COMPREPLY=()
100    cur=`_get_cword`
101    prev=${COMP_WORDS[COMP_CWORD-1]}
102
103    case "$prev" in
104        -i)
105            _interfaces
106            return 0
107            ;;
108    esac
109
110    if [[ "$cur" == -* ]]; then
111        COMPREPLY=( $( compgen -W '-i -v' -- "$cur" ) )
112    fi
113
114} &&
115complete -F _snarf filesnarf mailsnarf msgsnarf
116
117# macof(8) completion
118#
119have macof &&
120_macof()
121{
122    local cur prev
123
124    COMPREPLY=()
125    cur=`_get_cword`
126    prev=${COMP_WORDS[COMP_CWORD-1]}
127
128    case "$prev" in
129        -i)
130            _interfaces
131            return 0
132            ;;
133    esac
134
135
136    if [[ "$cur" == -* ]]; then
137        COMPREPLY=( $( compgen -W '-i -s -d -e -x -y -n' -- "$cur" ) )
138    fi
139
140} &&
141complete -F _macof macof
142
143# sshmitm(8) completion
144#
145have sshmitm &&
146_sshmitm()
147{
148    local cur
149
150    COMPREPLY=()
151    cur=`_get_cword`
152
153    if [[ "$cur" == -* ]]; then
154        COMPREPLY=( $( compgen -W '-d -I -p' -- "$cur" ) )
155    else
156        _known_hosts_real "$cur"
157    fi
158
159} &&
160complete -F _sshmitm sshmitm
161
162# sshow(8) completion
163#
164have sshow &&
165_sshow()
166{
167    local cur prev
168
169    COMPREPLY=()
170    cur=`_get_cword`
171    prev=${COMP_WORDS[COMP_CWORD-1]}
172
173    case "$prev" in
174        -i)
175            _interfaces
176            return 0
177            ;;
178    esac
179
180    if [[ "$cur" == -* ]]; then
181        COMPREPLY=( $( compgen -W '-d -i' -- "$cur" ) )
182    fi
183
184} &&
185complete -F _sshow sshow
186
187# tcpkill(8) completion
188#
189have tcpkill &&
190_tcpkill()
191{
192    local cur prev
193
194    COMPREPLY=()
195    cur=`_get_cword`
196    prev=${COMP_WORDS[COMP_CWORD-1]}
197
198    case "$prev" in
199        -i)
200            _interfaces
201            return 0
202            ;;
203    esac
204
205    if [[ "$cur" == -* ]]; then
206        COMPREPLY=( $( compgen -W '-i -1 -2 -3 -4 -5 -6 -7 -8 -9' -- "$cur" ) )
207    fi
208
209} &&
210complete -F _tcpkill tcpkill
211
212# tcpnice(8) completion
213#
214have tcpnice &&
215_tcpnice()
216{
217    local cur prev
218
219    COMPREPLY=()
220    cur=`_get_cword`
221    prev=${COMP_WORDS[COMP_CWORD-1]}
222
223    case "$prev" in
224        -i)
225            _interfaces
226            return 0
227            ;;
228    esac
229
230    if [[ "$cur" == -* ]]; then
231        COMPREPLY=( $( compgen -W '-A -I -M -i' -- "$cur" ) )
232    fi
233
234} &&
235complete -F _tcpnice tcpnice
236
237# urlsnarf(8) completion
238#
239have urlsnarf &&
240_urlsnarf()
241{
242    local cur prev
243
244    COMPREPLY=()
245    cur=`_get_cword`
246    prev=${COMP_WORDS[COMP_CWORD-1]}
247
248    case "$prev" in
249        -i)
250            _interfaces
251            return 0
252            ;;
253    esac
254
255    if [[ "$cur" == -* ]]; then
256        COMPREPLY=( $( compgen -W '-n -i -v' -- "$cur" ) )
257    fi
258
259} &&
260complete -F _urlsnarf urlsnarf
261
262# webmitm(8) completion
263#
264have webmitm &&
265_webmitm()
266{
267    local cur
268
269    COMPREPLY=()
270    cur=`_get_cword`
271
272    if [[ "$cur" == -* ]]; then
273        COMPREPLY=( $( compgen -W '-d' -- "$cur" ) )
274    else
275        _known_hosts_real "$cur"
276    fi
277
278} &&
279complete -F _webmitm webmitm
280
281# Local variables:
282# mode: shell-script
283# sh-basic-offset: 4
284# sh-indent-comment: t
285# indent-tabs-mode: nil
286# End:
287# ex: ts=4 sw=4 et filetype=sh