diff options
Diffstat (limited to 'llvm/lib/Support/CommandLine.cpp')
-rw-r--r-- | llvm/lib/Support/CommandLine.cpp | 10 |
1 files changed, 6 insertions, 4 deletions
diff --git a/llvm/lib/Support/CommandLine.cpp b/llvm/lib/Support/CommandLine.cpp index 76bf45e8f51..756df942020 100644 --- a/llvm/lib/Support/CommandLine.cpp +++ b/llvm/lib/Support/CommandLine.cpp @@ -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"; |