Skip to content

Commit 02c60fa

Browse files
committed
refactor: COMP_CONFIGURE_HINTS to `BASH_COMPLETION_CMD_CONFIGURE_HINTS
The old name still serves as the (undocumented) fallback.
1 parent 966293f commit 02c60fa

File tree

3 files changed

+5
-4
lines changed

3 files changed

+5
-4
lines changed

completions/configure

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -25,9 +25,9 @@ _configure()
2525
return
2626
fi
2727

28-
# if $COMP_CONFIGURE_HINTS is not null, then completions of the form
29-
# --option=SETTING will include 'SETTING' as a contextual hint
30-
if [[ ${COMP_CONFIGURE_HINTS-} ]]; then
28+
# if $BASH_COMPLETION_CMD_CONFIGURE_HINTS is not null, then completions of
29+
# the form --option=SETTING will include 'SETTING' as a contextual hint
30+
if [[ ${BASH_COMPLETION_CMD_CONFIGURE_HINTS-${COMP_CONFIGURE_HINTS-}} ]]; then
3131
COMPREPLY=($(compgen -W "$($1 --help 2>&1 |
3232
awk '/^ --[A-Za-z]/ { print $1; \
3333
if ($2 ~ /--[A-Za-z]/) print $2 }' | command sed -e 's/[[,].*//g')" \

doc/bash_completion.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@
2222
loaded. If unset or null, the default compatibility directory to use is
2323
`/etc/bash_completion.d`.
2424

25-
*COMP_CONFIGURE_HINTS*::
25+
*BASH_COMPLETION_CMD_CONFIGURE_HINTS*::
2626
If set and not null, `configure` completion will return the entire option
2727
string (e.g. `--this-option=DESCRIPTION`) so one can see what kind of data
2828
is required and then simply delete the descriptive text and add one's own

test/config/bashrc

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -45,6 +45,7 @@ export XDG_DATA_DIRS=/var/empty
4545

4646
# Make sure default settings are in effect
4747
unset -v \
48+
BASH_COMPLETION_CMD_CONFIGURE_HINTS \
4849
BASH_COMPLETION_CMD_IWCONFIG_SCAN \
4950
BASH_COMPLETION_FILEDIR_FALLBACK \
5051
COMP_CONFIGURE_HINTS \

0 commit comments

Comments
 (0)