diff options
author | Igor Kudrin <ikudrin@accesssoftek.com> | 2023-12-09 01:32:07 +0700 |
---|---|---|
committer | GitHub <noreply@github.com> | 2023-12-09 01:32:07 +0700 |
commit | 9d66d263ad4371160320f4f91720a345eb241471 (patch) | |
tree | 3592ed3081e4c6b6e6f428dcc35589ed839f08b1 /llvm/lib/Support/CommandLine.cpp | |
parent | a5891fa4d2b76cf9dec96da9ded59fc4937d3342 (diff) | |
download | llvm-9d66d263ad4371160320f4f91720a345eb241471.zip llvm-9d66d263ad4371160320f4f91720a345eb241471.tar.gz llvm-9d66d263ad4371160320f4f91720a345eb241471.tar.bz2 |
[CommandLine] Show '[subcommand]' in the help for less than 3 subcommands (#74557)
When a tool defines only one or two subcommands, the `[subcommand]` part
is not displayed in the `USAGE` help line. Note that a similar issue
for printing the list of the subcommands has been fixed in
https://reviews.llvm.org/D25463.
Diffstat (limited to 'llvm/lib/Support/CommandLine.cpp')
-rw-r--r-- | llvm/lib/Support/CommandLine.cpp | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/llvm/lib/Support/CommandLine.cpp b/llvm/lib/Support/CommandLine.cpp index a7e0cae..31f7997 100644 --- a/llvm/lib/Support/CommandLine.cpp +++ b/llvm/lib/Support/CommandLine.cpp @@ -2372,7 +2372,7 @@ public: if (Sub == &SubCommand::getTopLevel()) { outs() << "USAGE: " << GlobalParser->ProgramName; - if (Subs.size() > 2) + if (!Subs.empty()) outs() << " [subcommand]"; outs() << " [options]"; } else { |