diff options
author | Daniel Baumann <daniel.baumann@progress-linux.org> | 2024-04-28 09:14:42 +0000 |
---|---|---|
committer | Daniel Baumann <daniel.baumann@progress-linux.org> | 2024-04-28 09:14:42 +0000 |
commit | 0bc58b66a4850cdb8458a86c3d9a2fc81de82aa3 (patch) | |
tree | ea0fe36eb5e6f40e0a1f765d44c4b0c0b2bfb089 /completions/pack200 | |
parent | Initial commit. (diff) | |
download | bash-completion-0bc58b66a4850cdb8458a86c3d9a2fc81de82aa3.tar.xz bash-completion-0bc58b66a4850cdb8458a86c3d9a2fc81de82aa3.zip |
Adding upstream version 1:2.11.upstream/1%2.11upstream
Signed-off-by: Daniel Baumann <daniel.baumann@progress-linux.org>
Diffstat (limited to '')
-rw-r--r-- | completions/pack200 | 74 |
1 files changed, 74 insertions, 0 deletions
diff --git a/completions/pack200 b/completions/pack200 new file mode 100644 index 0000000..1a6ded7 --- /dev/null +++ b/completions/pack200 @@ -0,0 +1,74 @@ +# pack200(1) completion -*- shell-script -*- + +_pack200() +{ + local cur prev words cword split + _init_completion -s || return + + case $prev in + -S | --segment-limit | -P | --pass-file | -C | --class-attribute | \ + -F | --field-attribute | -M | --method-attribute | -D | --code-attribute | \ + '-?' | -h | --help | -V | --version | -J) + return + ;; + -E | --effort) + COMPREPLY=($(compgen -W '{0..9}' -- "$cur")) + return + ;; + -H | --deflate-hint) + COMPREPLY=($(compgen -W 'true false keep' -- "$cur")) + return + ;; + -m | --modification-time) + COMPREPLY=($(compgen -W 'latest keep' -- "$cur")) + return + ;; + -U | --unknown-attribute) + COMPREPLY=($(compgen -W 'error strip pass' -- "$cur")) + return + ;; + -f | --config-file) + _filedir properties + return + ;; + -l | --log-file) + COMPREPLY=($(compgen -W '-' -- "$cur")) + _filedir log + return + ;; + -r | --repack) + _filedir jar + return + ;; + esac + + $split && return + + # Check if a pack or a jar was already given. + local i pack=false jar=false + for ((i = 1; 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 '--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)' + fi + elif ! $jar; then + _filedir jar + fi +} && + complete -F _pack200 pack200 + +# ex: filetype=sh |