We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 5ffe2de commit 908e5ecCopy full SHA for 908e5ec
utils/bash-autocomplete.sh
@@ -22,16 +22,17 @@ _clang()
22
elif [[ "$w2" == -* && "$w1" == '=' ]]; then
23
# -foo=bar<tab>
24
arg="$w2=,$cur"
25
- else
26
- _filedir
27
fi
28
29
local flags=$( clang --autocomplete="$arg" )
30
- if [[ "$cur" == "=" ]]; then
+ if [[ "$cur" == '=' ]]; then
31
COMPREPLY=( $( compgen -W "$flags" -- "") )
32
- elif [[ "$flags" == "" ]]; then
+ elif [[ "$flags" == "" || "$arg" == "" ]]; then
33
_filedir
34
else
+ # Bash automatically appends a space after '=' by default.
+ # Disable it so that it works nicely for options in the form of -foo=bar.
35
+ [[ "${flags: -1}" == '=' ]] && compopt -o nospace
36
COMPREPLY=( $( compgen -W "$flags" -- "$cur" ) )
37
38
}
0 commit comments