diff options
Diffstat (limited to 'completions/unpack200')
-rw-r--r-- | completions/unpack200 | 54 |
1 files changed, 54 insertions, 0 deletions
diff --git a/completions/unpack200 b/completions/unpack200 new file mode 100644 index 00000000..208ad471 --- /dev/null +++ b/completions/unpack200 @@ -0,0 +1,54 @@ +# unpack200(1) completion + +_unpack200() +{ + local cur prev words cword split + _init_completion -s || return + + case $prev in + '-?'|-h|--help|-V|--version|-J) + return 0 + ;; + -H|--deflate-hint) + COMPREPLY=( $( compgen -W 'true false keep' -- "$cur" ) ) + return 0 + ;; + -l|--log-file) + COMPREPLY=( $( compgen -W '-' -- "$cur" ) ) + _filedir log + return 0 + ;; + esac + + $split && return + + # Check if a pack or a jar was already given. + local i pack=false jar=false + for (( i=0; i < ${#words[@]}-1; i++ )) ; do + case ${words[i]} in + *.pack|*.pack.gz) pack=true ;; + *.jar) jar=true ;; + esac + done + + if ! $pack ; then + if [[ "$cur" == -* ]] ; then + COMPREPLY=( $( compgen -W '--deflate-hint= --remove-pack-file \ + --verbose --quiet --log-file= --help --version' -- "$cur" ) ) + [[ $COMPREPLY == *= ]] && compopt -o nospace + else + _filedir 'pack?(.gz)' + fi + elif ! $jar ; then + _filedir jar + fi +} && +complete -F _unpack200 unpack200 + +# Local variables: +# mode: shell-script +# sh-basic-offset: 4 +# sh-indent-comment: t +# indent-tabs-mode: nil +# End: +# ex: ts=4 sw=4 et filetype=sh |