mirror of
https://github.com/RPCSX/llvm.git
synced 2025-02-14 09:56:23 +00:00
[cl] Don't print subcommand help when no subcommands present.
Previously we would print USAGE: <exe> [subcommand] [options] Even if no subcommands were present. This changes the output format to only print "[subcommand]" if there is at least one subcommand. Fixes llvm.org/pr30598 Patch by Serge Guelton git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@283892 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
parent
b3c22e4e95
commit
ed36d63443
@ -1756,10 +1756,12 @@ public:
|
||||
if (!GlobalParser->ProgramOverview.empty())
|
||||
outs() << "OVERVIEW: " << GlobalParser->ProgramOverview << "\n";
|
||||
|
||||
if (Sub == &*TopLevelSubCommand)
|
||||
outs() << "USAGE: " << GlobalParser->ProgramName
|
||||
<< " [subcommand] [options]";
|
||||
else {
|
||||
if (Sub == &*TopLevelSubCommand) {
|
||||
outs() << "USAGE: " << GlobalParser->ProgramName;
|
||||
if (Subs.size() > 2)
|
||||
outs() << " [subcommand]";
|
||||
outs() << " [options]";
|
||||
} else {
|
||||
if (!Sub->getDescription().empty()) {
|
||||
outs() << "SUBCOMMAND '" << Sub->getName()
|
||||
<< "': " << Sub->getDescription() << "\n\n";
|
||||
|
Loading…
x
Reference in New Issue
Block a user