# pack200(1) completion -*- shell-script -*- proc _pack200 { local cur prev words cword split _init_completion -s || return match $prev { with -S|--segment-limit|-P|--pass-file|-C|--class-attribute|\ -F|--field-attribute|-M|--method-attribute|-D|--code-attribute|\ '-?'|-h|--help|-V|--version|-J return 0 with -E|--effort setglobal COMPREPLY = ''( $( compgen -W '{0..9}' -- "$cur" ) ) return 0 with -H|--deflate-hint setglobal COMPREPLY = ''( $( compgen -W 'true false keep' -- "$cur" ) ) return 0 with -m|--modification-time setglobal COMPREPLY = ''( $( compgen -W 'latest keep' -- "$cur" ) ) return 0 with -U|--unknown-attribute setglobal COMPREPLY = ''( $( compgen -W 'error strip pass' -- "$cur" ) ) return 0 with -f|--config-file _filedir properties return 0 with -l|--log-file setglobal COMPREPLY = ''( $( compgen -W '-' -- "$cur" ) ) _filedir log return 0 with -r|--repack _filedir jar return 0 } $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 { if [[ "$cur" == -* ]] { setglobal COMPREPLY = ''( $( compgen -W '--no-gzip --gzip --strip-debug --no-keep-file-order --segment-limit= --effort= --deflate-hint= --modification-time= --pass-file= --unknown-attribute= --class-attribute= --field-attribute= --method-attribute= --code-attribute= --config-file= --verbose --quiet --log-file= --help --version -J --repack' -- "$cur" ) ) [[ $COMPREPLY == *= ]] && compopt -o nospace } else { _filedir 'pack?(.gz)' } } elif ! $jar { _filedir jar } } && complete -F _pack200 pack200 # ex: ts=4 sw=4 et filetype=sh