[llvm-branch-commits] [llvm-branch] r309437 - Merging r309113:
Hans Wennborg via llvm-branch-commits
llvm-branch-commits at lists.llvm.org
Fri Jul 28 14:29:27 PDT 2017
Author: hans
Date: Fri Jul 28 14:29:27 2017
New Revision: 309437
URL: http://llvm.org/viewvc/llvm-project?rev=309437&view=rev
Log:
Merging r309113:
------------------------------------------------------------------------
r309113 | yamaguchi | 2017-07-26 06:36:58 -0700 (Wed, 26 Jul 2017) | 19 lines
[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
------------------------------------------------------------------------
Modified:
llvm/branches/release_50/ (props changed)
llvm/branches/release_50/lib/Option/OptTable.cpp
Propchange: llvm/branches/release_50/
------------------------------------------------------------------------------
--- svn:mergeinfo (original)
+++ svn:mergeinfo Fri Jul 28 14:29:27 2017
@@ -1,3 +1,3 @@
/llvm/branches/Apple/Pertwee:110850,110961
/llvm/branches/type-system-rewrite:133420-134817
-/llvm/trunk:155241,308483-308484,308503,308808,308813,308891,308906,308950,308963,308978,308986,309302
+/llvm/trunk:155241,308483-308484,308503,308808,308813,308891,308906,308950,308963,308978,308986,309113,309302
Modified: llvm/branches/release_50/lib/Option/OptTable.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/branches/release_50/lib/Option/OptTable.cpp?rev=309437&r1=309436&r2=309437&view=diff
==============================================================================
--- llvm/branches/release_50/lib/Option/OptTable.cpp (original)
+++ llvm/branches/release_50/lib/Option/OptTable.cpp Fri Jul 28 14:29:27 2017
@@ -235,7 +235,9 @@ OptTable::findByPrefix(StringRef Cur, un
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);
}
More information about the llvm-branch-commits
mailing list