diff options
author | Daniel Baumann <daniel.baumann@progress-linux.org> | 2024-05-04 01:03:18 +0000 |
---|---|---|
committer | Daniel Baumann <daniel.baumann@progress-linux.org> | 2024-05-04 01:03:18 +0000 |
commit | f2621414ee5f2f601424c22f00e207903e3b6104 (patch) | |
tree | 56a856dafd1ca684bb23263cacaa723ee4f404fc /completions/lrzip | |
parent | Adding debian version 1:2.11-8. (diff) | |
download | bash-completion-f2621414ee5f2f601424c22f00e207903e3b6104.tar.xz bash-completion-f2621414ee5f2f601424c22f00e207903e3b6104.zip |
Merging upstream version 1:2.12.0.
Signed-off-by: Daniel Baumann <daniel.baumann@progress-linux.org>
Diffstat (limited to 'completions/lrzip')
-rw-r--r-- | completions/lrzip | 44 |
1 files changed, 24 insertions, 20 deletions
diff --git a/completions/lrzip b/completions/lrzip index eb2904c..6f40be7 100644 --- a/completions/lrzip +++ b/completions/lrzip @@ -1,52 +1,56 @@ # lrzip(1) completion -*- shell-script -*- -_lrzip() +_comp_cmd_lrzip() { - local cur prev words cword - _init_completion || return + local cur prev words cword comp_args + _comp_initialize -- "$@" || return local xspec="*.lrz" + local noargopts='!(-*|*[SmwdoOLNp]*)' + # shellcheck disable=SC2254 case $prev in - -*@([wSm]|[Vh?]*)) + --help | --version | --suffix | --maxram | --window | \ + -${noargopts}@([Smw]|[h?V]*)) return ;; - -*d) + --decompress | -${noargopts}d) xspec="!"$xspec ;; - -*o) - _filedir + --outfile | -${noargopts}o) + _comp_compgen_filedir return ;; - -*O) - _filedir -d + --outdir | -${noargopts}O) + _comp_compgen_filedir -d return ;; - -*L) - COMPREPLY=($(compgen -W '{1..9}' -- "$cur")) + --level | -${noargopts}L) + _comp_compgen -- -W '{1..9}' return ;; - -*N) - COMPREPLY=($(compgen -W '{-20..19}' -- "$cur")) + --nice-level | -${noargopts}N) + _comp_compgen -- -W '{-20..19}' return ;; - -*p) - COMPREPLY=($(compgen -W "{1..$(_ncpus)}" -- "$cur")) + --threads | -${noargopts}p) + local REPLY + _comp_get_ncpus + _comp_compgen -- -W "{1..$REPLY}" return ;; esac if [[ $cur == -* ]]; then - COMPREPLY=($(compgen -W '$(_parse_help "$1")' -- "$cur")) + _comp_compgen_help return fi - _tilde "$cur" || return + _comp_compgen_tilde && return - local IFS=$'\n' compopt -o filenames - COMPREPLY=($(compgen -f -X "$xspec" -- "$cur") $(compgen -d -- "$cur")) + _comp_compgen -- -f -X "$xspec" -o plusdirs } && - complete -F _lrzip lrzip + complete -F _comp_cmd_lrzip lrzip # ex: filetype=sh |