Skip to content

Commit

Permalink
[Bash-autocompletion] Invoke clang where user called
Browse files Browse the repository at this point in the history
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
  • Loading branch information
yamaguchi1024 committed Jun 28, 2017
1 parent 2cbf037 commit 28782be
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion clang/utils/bash-autocomplete.sh
Expand Up @@ -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
Expand Down

0 comments on commit 28782be

Please sign in to comment.