summaryrefslogtreecommitdiffstats
path: root/completions/configure
diff options
context:
space:
mode:
authorDaniel Baumann <daniel.baumann@progress-linux.org>2024-05-04 01:03:19 +0000
committerDaniel Baumann <daniel.baumann@progress-linux.org>2024-05-04 01:03:19 +0000
commit6c09f2a45c5541e9c207d14fc7aa21a4a0066bde (patch)
tree0221189d367bf661f6f9493c4f17a03f0dd4b7d2 /completions/configure
parentReleasing progress-linux version 1:2.11-8~progress7.99u1. (diff)
downloadbash-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/configure')
-rw-r--r--completions/configure37
1 files changed, 20 insertions, 17 deletions
diff --git a/completions/configure b/completions/configure
index 3f59a01..a61a05d 100644
--- a/completions/configure
+++ b/completions/configure
@@ -1,9 +1,12 @@
# bash completion for configure -*- shell-script -*-
-_configure()
+_comp_deprecate_var 2.12 \
+ COMP_CONFIGURE_HINTS BASH_COMPLETION_CMD_CONFIGURE_HINTS
+
+_comp_cmd_configure()
{
- local cur prev words cword split
- _init_completion -s || return
+ local cur prev words cword was_split comp_args
+ _comp_initialize -s -- "$@" || return
case $prev in
-h | --help | -V | --version | --program-prefix | --program-suffix | \
@@ -11,32 +14,32 @@ _configure()
return
;;
--*file)
- _filedir
+ _comp_compgen_filedir
return
;;
--*prefix | --*dir)
- _filedir -d
+ _comp_compgen_filedir -d
return
;;
esac
- $split && return
-
- # if $COMP_CONFIGURE_HINTS is not null, then completions of the form
- # --option=SETTING will include 'SETTING' as a contextual hint
- [[ $cur != -* ]] && return
+ if [[ $was_split || $cur != -* ]]; then
+ _comp_compgen_filedir
+ return
+ fi
- if [[ ${COMP_CONFIGURE_HINTS-} ]]; then
- COMPREPLY=($(compgen -W "$($1 --help 2>&1 |
- awk '/^ --[A-Za-z]/ { print $1; \
- if ($2 ~ /--[A-Za-z]/) print $2 }' | command sed -e 's/[[,].*//g')" \
- -- "$cur"))
+ # if $BASH_COMPLETION_CMD_CONFIGURE_HINTS is not null, then completions of
+ # the form --option=SETTING will include 'SETTING' as a contextual hint
+ if [[ ${BASH_COMPLETION_CMD_CONFIGURE_HINTS-} ]]; then
+ _comp_compgen_split -- "$("$1" --help 2>&1 |
+ _comp_awk '/^ --[A-Za-z]/ { print $1; \
+ if ($2 ~ /--[A-Za-z]/) print $2 }' | command sed -e 's/[[,].*//g')"
[[ ${COMPREPLY-} == *=* ]] && compopt -o nospace
else
- COMPREPLY=($(compgen -W '$(_parse_help "$1")' -- "$cur"))
+ _comp_compgen_help
[[ ${COMPREPLY-} == *= ]] && compopt -o nospace
fi
} &&
- complete -F _configure configure
+ complete -F _comp_cmd_configure configure
# ex: filetype=sh