diff options
author | Yuka Takahashi <yukatkh@gmail.com> | 2017-07-01 16:30:02 +0000 |
---|---|---|
committer | Yuka Takahashi <yukatkh@gmail.com> | 2017-07-01 16:30:02 +0000 |
commit | 558f3dd527d3774bff70a53c5ab91a20c1f72b19 (patch) | |
tree | 4d88b867d888ec1d2a4fd5f5df688f93f3912ee1 /clang/utils/bash-autocomplete.sh | |
parent | f7c4d7b0b161be9c1528095c012504d15a6da045 (diff) | |
download | bcm5719-llvm-558f3dd527d3774bff70a53c5ab91a20c1f72b19.tar.gz bcm5719-llvm-558f3dd527d3774bff70a53c5ab91a20c1f72b19.zip |
[Bash-completion] Fixed a bug that ~ doesn't expanded to $HOME
Summary: `~/build/bin/clang -f[tab]` was executed without ~ expanded to $HOME, so changed this by expanding ~ to path using eval.
Differential Revision: https://reviews.llvm.org/D34925
llvm-svn: 306957
Diffstat (limited to 'clang/utils/bash-autocomplete.sh')
-rw-r--r-- | clang/utils/bash-autocomplete.sh | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/clang/utils/bash-autocomplete.sh b/clang/utils/bash-autocomplete.sh index 775b1f45351..4f9853accc8 100644 --- a/clang/utils/bash-autocomplete.sh +++ b/clang/utils/bash-autocomplete.sh @@ -24,7 +24,9 @@ _clang() arg="$w2=,$cur" fi - flags=$( "${COMP_WORDS[0]}" --autocomplete="$arg" 2>/dev/null ) + # expand ~ to $HOME + eval local path=${COMP_WORDS[0]} + flags=$( "$path" --autocomplete="$arg" 2>/dev/null ) # If clang is old that it does not support --autocomplete, # fall back to the filename completion. if [[ "$?" != 0 ]]; then |