summaryrefslogtreecommitdiffstats
path: root/llvm/lib/Option
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
commit66256906c393b3fe9dad39bc7908cdd7c023e79b (patch)
tree62ab04614870f99d0c1a0977aec8c1434d27f5fa /llvm/lib/Option
parent8c000110cf3a858aa34bff1ea63f17daba4f41bb (diff)
downloadbcm5719-llvm-66256906c393b3fe9dad39bc7908cdd7c023e79b.tar.gz
bcm5719-llvm-66256906c393b3fe9dad39bc7908cdd7c023e79b.zip
[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 llvm-svn: 309113
Diffstat (limited to 'llvm/lib/Option')
-rw-r--r--llvm/lib/Option/OptTable.cpp4
1 files changed, 3 insertions, 1 deletions
diff --git a/llvm/lib/Option/OptTable.cpp b/llvm/lib/Option/OptTable.cpp
index 071c9db8720..7910bea0dcc 100644
--- a/llvm/lib/Option/OptTable.cpp
+++ b/llvm/lib/Option/OptTable.cpp
@@ -235,7 +235,9 @@ OptTable::findByPrefix(StringRef Cur, unsigned short DisableFlags) const {
continue;
for (int I = 0; In.Prefixes[I]; I++) {
- std::string S = std::string(In.Prefixes[I]) + std::string(In.Name);
+ std::string S = std::string(In.Prefixes[I]) + std::string(In.Name) + "\t";
+ if (In.HelpText)
+ S += In.HelpText;
if (StringRef(S).startswith(Cur))
Ret.push_back(S);
}
OpenPOWER on IntegriCloud