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 | ce9e71cd0837f7e5e4ea30a14d49d193cf6201e1 (patch) | |
tree | 37faa02cec58664373e9898c83815e741a9671c6 /utils | |
parent | b872b4465911005979d9746d8e7a912d9fa4c402 (diff) |
[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
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@306957 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'utils')
-rw-r--r-- | utils/bash-autocomplete.sh | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/utils/bash-autocomplete.sh b/utils/bash-autocomplete.sh index 775b1f4535..4f9853accc 100644 --- a/utils/bash-autocomplete.sh +++ b/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 |