diff options
author | Daniel Baumann <daniel.baumann@progress-linux.org> | 2024-05-04 01:03:19 +0000 |
---|---|---|
committer | Daniel Baumann <daniel.baumann@progress-linux.org> | 2024-05-04 01:03:19 +0000 |
commit | 6c09f2a45c5541e9c207d14fc7aa21a4a0066bde (patch) | |
tree | 0221189d367bf661f6f9493c4f17a03f0dd4b7d2 /completions/complete | |
parent | Releasing progress-linux version 1:2.11-8~progress7.99u1. (diff) | |
download | bash-completion-6c09f2a45c5541e9c207d14fc7aa21a4a0066bde.tar.xz bash-completion-6c09f2a45c5541e9c207d14fc7aa21a4a0066bde.zip |
Merging upstream version 1:2.12.0.
Signed-off-by: Daniel Baumann <daniel.baumann@progress-linux.org>
Diffstat (limited to 'completions/complete')
-rw-r--r-- | completions/complete | 34 |
1 files changed, 17 insertions, 17 deletions
diff --git a/completions/complete b/completions/complete index a57f366..74ae3f9 100644 --- a/completions/complete +++ b/completions/complete @@ -1,49 +1,49 @@ # bash complete completion -*- shell-script -*- -_complete() +_comp_cmd_complete() { - local cur prev words cword - _init_completion || return + local cur prev words cword comp_args + _comp_initialize -- "$@" || return case $prev in -*o) - COMPREPLY=($(compgen -W 'bashdefault default dirnames filenames - nospace plusdirs' -- "$cur")) + _comp_compgen -- -W 'bashdefault default dirnames filenames nospace + plusdirs' return ;; -*A) - COMPREPLY=($(compgen -W 'alias arrayvar binding builtin command + _comp_compgen -- -W 'alias arrayvar binding builtin command directory disabled enabled export file function group helptopic hostname job keyword running service setopt shopt signal - stopped user variable' -- "$cur")) + stopped user variable' return ;; -*C) - COMPREPLY=($(compgen -A command -- "$cur")) + _comp_compgen -- -A command return ;; -*F) - COMPREPLY=($(compgen -A function -- "$cur")) + _comp_compgen -- -A function return ;; -*p | -*r) - COMPREPLY=($(complete -p | command sed -e 's|.* ||')) - COMPREPLY=($(compgen -W '${COMPREPLY[@]}' -- "$cur")) + _comp_compgen_split -l -- "$(complete -p | command sed -e 's|.* ||')" return ;; esac if [[ $cur == -* ]]; then - # relevant options completion - local opts="-a -b -c -d -e -f -g -j -k -o -s -u -v -A -G -W -P -S -X" - [[ $1 != compgen ]] && opts+=" -F -C" - COMPREPLY=($(compgen -W "$opts" -- "$cur")) + local -a opts + _comp_compgen -v opts usage -c help -s "$1" + # -F, -C do not work the expected way with compgen + [[ $1 != *compgen ]] || opts=("${opts[@]//-[FC]/}") + _comp_compgen -- -W '"${opts[@]}"' -X '' else - COMPREPLY=($(compgen -A command -- "$cur")) + _comp_compgen -- -A command fi } && - complete -F _complete compgen complete + complete -F _comp_cmd_complete compgen complete # ex: filetype=sh |