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 | f4acb49ea148cdd899f7f29f1591c7bc853c2135 (patch) | |
tree | b62d60873864065d6428a84a119dd8a3c90f1397 /completions/ccache | |
parent | Adding upstream version 1:2.11. (diff) | |
download | bash-completion-f4acb49ea148cdd899f7f29f1591c7bc853c2135.tar.xz bash-completion-f4acb49ea148cdd899f7f29f1591c7bc853c2135.zip |
Adding upstream version 1:2.12.0.upstream/1%2.12.0
Signed-off-by: Daniel Baumann <daniel.baumann@progress-linux.org>
Diffstat (limited to 'completions/ccache')
-rw-r--r-- | completions/ccache | 30 |
1 files changed, 16 insertions, 14 deletions
diff --git a/completions/ccache b/completions/ccache index 80c39de..fb3f3e4 100644 --- a/completions/ccache +++ b/completions/ccache @@ -1,38 +1,40 @@ # ccache(1) completion -*- shell-script -*- -_ccache() +_comp_cmd_ccache() { - local cur prev words cword split - _init_completion -s || return + local cur prev words cword was_split comp_args + _comp_initialize -s -- "$@" || return local i - for ((i = 1; i <= COMP_CWORD; i++)); do - if [[ ${COMP_WORDS[i]} != -* ]]; then - _command_offset $i + for ((i = 1; i <= cword; i++)); do + if [[ ${words[i]} != -* ]]; then + _comp_command_offset $i return fi - [[ ${COMP_WORDS[i]} == -*[oFM] ]] && ((i++)) + [[ ${words[i]} == -*[oFM] ]] && ((i++)) done + local noargopts='!(-*|*[FMo]*)' + # shellcheck disable=SC2254 case $prev in - --help | --version | --max-files | --max-size | -!(-*)[hVFM]) + --help | --version | --max-files | --max-size | -${noargopts}[hVFM]) return ;; - --set-config | -!(-*)o) + --set-config | -${noargopts}o) if [[ $cur != *=* ]]; then - COMPREPLY=($(compgen -S = -W "$($1 -p 2>/dev/null | - awk '$3 = "=" { print $2 }')" -- "$cur")) + _comp_compgen_split -S = -- "$("$1" -p 2>/dev/null | + _comp_awk '$3 = "=" { print $2 }')" [[ ${COMPREPLY-} == *= ]] && compopt -o nospace fi return ;; esac - $split && return + [[ $was_split ]] && return - COMPREPLY=($(compgen -W '$(_parse_help "$1")' -- "$cur")) + _comp_compgen_help [[ ${COMPREPLY-} == *= ]] && compopt -o nospace } && - complete -F _ccache ccache + complete -F _comp_cmd_ccache ccache # ex: filetype=sh |