[Bash-autocompletion] Show flags which has HelpText or GroupID

Summary: Otherwise internal flags will be also completed.

Differential Revision: https://reviews.llvm.org/D34930

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@307116 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
Yuka Takahashi 2017-07-05 02:36:32 +00:00
parent 3f4f926b6a
commit 7a41a9b0dc

View File

@ -228,7 +228,7 @@ OptTable::suggestValueCompletions(StringRef Option, StringRef Arg) const {
std::vector<std::string> OptTable::findByPrefix(StringRef Cur) const {
std::vector<std::string> Ret;
for (const Info &In : OptionInfos.slice(FirstSearchableIndex)) {
if (!In.Prefixes)
if (!In.Prefixes || (!In.HelpText && !In.GroupID))
continue;
for (int I = 0; In.Prefixes[I]; I++) {
std::string S = std::string(In.Prefixes[I]) + std::string(In.Name);