Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(10)

Unified Diff: tools/gn/gn_main.cc

Issue 1939603002: gn: Stop printing all help when the command is unknown (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 4 years, 8 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: tools/gn/gn_main.cc
diff --git a/tools/gn/gn_main.cc b/tools/gn/gn_main.cc
index 135ed561a9cb9f7b9ca83e25db1db77e397edd02..245270ee52d01e56687b3eeba48f9f0b6de98939 100644
--- a/tools/gn/gn_main.cc
+++ b/tools/gn/gn_main.cc
@@ -73,9 +73,12 @@ int main(int argc, char** argv) {
if (found_command != command_map.end()) {
retval = found_command->second.runner(args);
} else {
- Err(Location(),
- "Command \"" + command + "\" unknown.").PrintToStdout();
- commands::RunHelp(std::vector<std::string>());
+ Err(Location(), "Command \"" + command + "\" unknown.").PrintToStdout();
+ OutputString(
+ "Available commands (type \"gn help <command>\" for more details):\n");
+ for (const auto& cmd : commands::GetCommands())
+ PrintShortHelp(cmd.second.help_short);
+
retval = 1;
}
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698