[Bash-autocompletion] Invoke clang where user called

Summary:
When user build clang and used completion Eg. `build/bin/clang -fno[tab]`, we want to invoke `build/bin/clang --autocomplete=-fno`, rather than `clang --autocomplete=-fno`.

Differential Revision: https://reviews.llvm.org/D34761

llvm-svn: 306559
This commit is contained in:
Yuka Takahashi 2017-06-28 16:29:26 +00:00
parent 2cbf03728a
commit 28782bea88
1 changed files with 1 additions and 1 deletions

View File

@ -24,7 +24,7 @@ _clang()
arg="$w2=,$cur"
fi
flags=$( clang --autocomplete="$arg" 2>/dev/null )
flags=$( "${COMP_WORDS[0]}" --autocomplete="$arg" 2>/dev/null )
# If clang is old that it does not support --autocomplete,
# fall back to the filename completion.
if [[ "$?" != 0 ]]; then