Skip to content

Commit d680287

Browse files
committedOct 12, 2016
[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
1 parent 1b9327f commit d680287

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed
 

Diff for: ‎llvm/lib/Support/CommandLine.cpp

+1-1
Original file line numberDiff line numberDiff line change
@@ -1780,7 +1780,7 @@ class HelpPrinter {
17801780
if (ConsumeAfterOpt)
17811781
outs() << " " << ConsumeAfterOpt->HelpStr;
17821782

1783-
if (Sub == &*TopLevelSubCommand && Subs.size() > 2) {
1783+
if (Sub == &*TopLevelSubCommand && !Subs.empty()) {
17841784
// Compute the maximum subcommand length...
17851785
size_t MaxSubLen = 0;
17861786
for (size_t i = 0, e = Subs.size(); i != e; ++i)

0 commit comments

Comments
 (0)
Please sign in to comment.