mirror of
https://github.com/RPCS3/llvm-mirror.git
synced 2024-11-25 04:02:41 +01:00
[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
This commit is contained in:
parent
ae92df8259
commit
a002b96ed1
@ -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);
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user