Skip to content
This repository was archived by the owner on Feb 5, 2019. It is now read-only.

Commit f268da9

Browse files
committed
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 ------------------------------------------------------------------------ git-svn-id: https://llvm.org/svn/llvm-project/llvm/branches/release_50@309437 91177308-0d34-0410-b5e6-96231b3b80d8
1 parent 43303b9 commit f268da9

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

lib/Option/OptTable.cpp

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -235,7 +235,9 @@ OptTable::findByPrefix(StringRef Cur, unsigned short DisableFlags) const {
235235
continue;
236236

237237
for (int I = 0; In.Prefixes[I]; I++) {
238-
std::string S = std::string(In.Prefixes[I]) + std::string(In.Name);
238+
std::string S = std::string(In.Prefixes[I]) + std::string(In.Name) + "\t";
239+
if (In.HelpText)
240+
S += In.HelpText;
239241
if (StringRef(S).startswith(Cur))
240242
Ret.push_back(S);
241243
}

0 commit comments

Comments
 (0)