summaryrefslogtreecommitdiff
path: root/utils/bash-autocomplete.sh
diff options
context:
space:
mode:
authorYuka Takahashi <yukatkh@gmail.com>2017-07-26 13:36:58 +0000
committerYuka Takahashi <yukatkh@gmail.com>2017-07-26 13:36:58 +0000
commit1a3ea7bcf31810c809716e53abe843f20fd523f4 (patch)
treee0eaed4cc9ea6e69d511a7da0f3dd38f4a913322 /utils/bash-autocomplete.sh
parent50fc19e4732a0370c1c046d6e95f5a02154a319b (diff)
downloadclang-1a3ea7bcf31810c809716e53abe843f20fd523f4.tar.gz
[Bash-autocompletion] Show HelpText with possible flags
Summary: `clang --autocomplete=-std` will show ``` -std: Language standard to compile for -std= Language standard to compile for -stdlib= C++ standard library to use ``` after this change. However, showing HelpText with completion in bash seems super tricky, so this feature will be used in other shells (fish, zsh...). Reviewers: v.g.vassilev, teemperor, ruiu Subscribers: cfe-commits, hiraditya Differential Revision: https://reviews.llvm.org/D35759 git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@309113 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'utils/bash-autocomplete.sh')
-rw-r--r--utils/bash-autocomplete.sh2
1 files changed, 1 insertions, 1 deletions
diff --git a/utils/bash-autocomplete.sh b/utils/bash-autocomplete.sh
index 83c168bf76..ed815d2d7a 100644
--- a/utils/bash-autocomplete.sh
+++ b/utils/bash-autocomplete.sh
@@ -57,7 +57,7 @@ _clang()
# expand ~ to $HOME
eval local path=${COMP_WORDS[0]}
- flags=$( "$path" --autocomplete="$arg" 2>/dev/null )
+ flags=$( "$path" --autocomplete="$arg" 2>/dev/null | sed -e 's/\t.*//' )
# If clang is old that it does not support --autocomplete,
# fall back to the filename completion.
if [[ "$?" != 0 ]]; then