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

Unified Diff: tools/gn/command_help.cc

Issue 2926013002: Support explicit pools in actions (Closed)
Patch Set: Remove console altogether Created 3 years, 6 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 | « tools/gn/builder.cc ('k') | tools/gn/docs/reference.md » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: tools/gn/command_help.cc
diff --git a/tools/gn/command_help.cc b/tools/gn/command_help.cc
index eb134562bce53285add1de1dd91c07c73e8abe98..a6777cfe692b4479e7970482d53257b686300ee6 100644
--- a/tools/gn/command_help.cc
+++ b/tools/gn/command_help.cc
@@ -245,10 +245,8 @@ int RunHelp(const std::vector<std::string>& args) {
// Check functions.
const functions::FunctionInfoMap& function_map = functions::GetFunctions();
auto found_function = function_map.find(what);
- if (found_function != function_map.end()) {
+ if (found_function != function_map.end())
PrintLongHelp(found_function->second.help);
- return 0;
- }
for (const auto& entry : function_map)
all_help_topics.push_back(entry.first);
@@ -256,10 +254,8 @@ int RunHelp(const std::vector<std::string>& args) {
const variables::VariableInfoMap& builtin_vars =
variables::GetBuiltinVariables();
auto found_builtin_var = builtin_vars.find(what);
- if (found_builtin_var != builtin_vars.end()) {
+ if (found_builtin_var != builtin_vars.end())
PrintLongHelp(found_builtin_var->second.help);
- return 0;
- }
for (const auto& entry : builtin_vars)
all_help_topics.push_back(entry.first);
@@ -267,13 +263,16 @@ int RunHelp(const std::vector<std::string>& args) {
const variables::VariableInfoMap& target_vars =
variables::GetTargetVariables();
auto found_target_var = target_vars.find(what);
- if (found_target_var != target_vars.end()) {
+ if (found_target_var != target_vars.end())
PrintLongHelp(found_target_var->second.help);
- return 0;
- }
for (const auto& entry : target_vars)
all_help_topics.push_back(entry.first);
+ if (found_function != function_map.end() ||
+ found_builtin_var != builtin_vars.end() ||
+ found_target_var != target_vars.end())
+ return 0;
+
// Random other topics.
std::map<std::string, void(*)()> random_topics;
random_topics["all"] = PrintAllHelp;
« no previous file with comments | « tools/gn/builder.cc ('k') | tools/gn/docs/reference.md » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698