diff options
author | Ville Skyttä <ville.skytta@iki.fi> | 2010-01-18 19:21:08 +0200 |
---|---|---|
committer | Ville Skyttä <ville.skytta@iki.fi> | 2010-01-18 19:21:08 +0200 |
commit | 08e746ea109366cd1ba6b52cb02e95c094726876 (patch) | |
tree | 190b5dc0e176acae9eb13dee2f2afd8b7b62789d /contrib/bzip2 | |
parent | 5d9e4f0c693fe1b3eaa5361a99b5409d166bec72 (diff) | |
download | bash-completion-08e746ea109366cd1ba6b52cb02e95c094726876.tar.gz |
Add pbzip2, pbunzip2, and pbzcat completions.
Diffstat (limited to 'contrib/bzip2')
-rw-r--r-- | contrib/bzip2 | 14 |
1 files changed, 10 insertions, 4 deletions
diff --git a/contrib/bzip2 b/contrib/bzip2 index 68fb7c5a..9001dd58 100644 --- a/contrib/bzip2 +++ b/contrib/bzip2 @@ -1,6 +1,6 @@ # bash completion for bzip2 -have bzip2 && +have bzip2 || have pbzip2 && _bzip2() { local cur prev xspec helpopts @@ -8,10 +8,16 @@ _bzip2() COMPREPLY=() cur=`_get_cword` prev=${COMP_WORDS[COMP_CWORD-1]} - helpopts=`_parse_help bzip2` + helpopts=`_parse_help ${COMP_WORDS[0]}` + + case $prev in + -b|-h|--help|-p) + return 0 + ;; + esac if [[ "$cur" == -* ]]; then - COMPREPLY=( $( compgen -W "$helpopts -2 -3 -4 -5 -6 -7 -8 -9" \ + COMPREPLY=( $( compgen -W "${helpopts//#/} -2 -3 -4 -5 -6 -7 -8 -9" \ -- "$cur" ) ) return 0 fi @@ -34,7 +40,7 @@ _bzip2() COMPREPLY=( $( compgen -f -X "$xspec" -- "$cur" ) \ $( compgen -d -- "$cur" ) ) } && -complete -F _bzip2 -o filenames bzip2 +complete -F _bzip2 -o filenames bzip2 pbzip2 # Local variables: # mode: shell-script |