forked from OSchip/llvm-project
[Support][CommandLine] Display subcommands in help when there are less than 3
subcommands This commit fixes a bug where the help output doesn't display subcommands when a tool has less than 3 subcommands. This change doesn't include a corresponding unittest as there is no viable way to provide a unittest for it. Differential Revision: https://reviews.llvm.org/D25463 llvm-svn: 283998
This commit is contained in:
parent
1b9327f332
commit
d680287898
|
@ -1780,7 +1780,7 @@ public:
|
|||
if (ConsumeAfterOpt)
|
||||
outs() << " " << ConsumeAfterOpt->HelpStr;
|
||||
|
||||
if (Sub == &*TopLevelSubCommand && Subs.size() > 2) {
|
||||
if (Sub == &*TopLevelSubCommand && !Subs.empty()) {
|
||||
// Compute the maximum subcommand length...
|
||||
size_t MaxSubLen = 0;
|
||||
for (size_t i = 0, e = Subs.size(); i != e; ++i)
|
||||
|
|
Loading…
Reference in New Issue