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/unpack200 | |
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/unpack200 | 48 |
1 files changed, 48 insertions, 0 deletions
diff --git a/completions/unpack200 b/completions/unpack200 new file mode 100644 index 0000000..8814259 --- /dev/null +++ b/completions/unpack200 @@ -0,0 +1,48 @@ +# unpack200(1) completion -*- shell-script -*- + +_unpack200() +{ + local cur prev words cword split + _init_completion -s || return + + case $prev in + --help | --version | -!(-*)[?hVJ]) + return + ;; + --deflate-hint | -!(-*)H) + COMPREPLY=($(compgen -W 'true false keep' -- "$cur")) + return + ;; + --log-file | -!(-*)l) + COMPREPLY=($(compgen -W '-' -- "$cur")) + _filedir log + return + ;; + esac + + $split && return + + # Check if a pack or a jar was already given. + local word pack=false jar=false + for word in "${words[@]:1}"; do + case $word 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 + +# ex: filetype=sh |