1
# bash completion for bzip2
3
have bzip2 || have pbzip2 &&
6
local cur prev xspec helpopts
9
_get_comp_words_by_ref cur prev
10
helpopts=`_parse_help ${COMP_WORDS[0]}`
18
if [[ "$cur" == -* ]]; then
19
COMPREPLY=( $( compgen -W "${helpopts//#/} -2 -3 -4 -5 -6 -7 -8 -9" \
27
if [[ "$prev" == --* ]]; then
28
[[ "$prev" == --decompress || \
29
"$prev" == --list || \
30
"$prev" == --test ]] && xspec="!"$xspec
31
[[ "$prev" == --compress ]] && xspec=
32
elif [[ "$prev" == -* ]]; then
33
[[ "$prev" == -*[dt]* ]] && xspec="!"$xspec
34
[[ "$prev" == -*z* ]] && xspec=
40
COMPREPLY=( $( compgen -f -X "$xspec" -- "$cur" ) \
41
$( compgen -d -- "$cur" ) )
43
complete -F _bzip2 bzip2 pbzip2
48
# sh-indent-comment: t
49
# indent-tabs-mode: nil
51
# ex: ts=4 sw=4 et filetype=sh