Index: tools/gn/command_help.cc |
diff --git a/tools/gn/command_help.cc b/tools/gn/command_help.cc |
index 0f8c34790a7d593dff32f67014c13b532fbdc3a9..9faf338b6fd91ee481fa649b25b180be733e0aac 100644 |
--- a/tools/gn/command_help.cc |
+++ b/tools/gn/command_help.cc |
@@ -56,6 +56,7 @@ void PrintToplevelHelp() { |
PrintShortHelp(target.second.help_short); |
OutputString("\nOther help topics:\n"); |
+ PrintShortHelp("all: Print all the help at once"); |
PrintShortHelp("buildargs: How build arguments work."); |
PrintShortHelp("dotfile: Info about the toplevel .gn file."); |
PrintShortHelp("label_pattern: Matching more than one label."); |
@@ -76,6 +77,39 @@ void PrintSwitchHelp() { |
PrintShortHelp(s.second.short_help); |
} |
+void PrintAllHelp() { |
+ PrintToplevelHelp(); |
+ |
+ for (const auto& s : switches::GetSwitches()) { |
brettw
2015/04/16 23:35:13
No {} for these loops
Dirk Pranke
2015/04/16 23:36:50
ah, right.
|
+ PrintLongHelp(s.second.long_help); |
+ } |
+ |
+ for (const auto& c: commands::GetCommands()) { |
brettw
2015/04/16 23:35:13
Space before the colon for these loops.
Dirk Pranke
2015/04/16 23:36:50
Acknowledged.
|
+ PrintLongHelp(c.second.help); |
+ } |
+ |
+ for (const auto& f: functions::GetFunctions()) { |
+ PrintLongHelp(f.second.help); |
+ } |
+ |
+ for (const auto& v: variables::GetBuiltinVariables()) { |
+ PrintLongHelp(v.second.help); |
+ } |
+ |
+ for (const auto& v: variables::GetTargetVariables()) { |
+ PrintLongHelp(v.second.help); |
+ } |
+ |
+ PrintLongHelp(kBuildArgs_Help); |
+ PrintLongHelp(kDotfile_Help); |
+ PrintLongHelp(kInputConversion_Help); |
+ PrintLongHelp(kLabelPattern_Help); |
+ PrintLongHelp(kSourceExpansion_Help); |
+ PrintSwitchHelp(); |
+} |
+ |
+ |
brettw
2015/04/16 23:35:13
Got some extra blank lines in here (should just be
Dirk Pranke
2015/04/16 23:36:50
Acknowledged.
|
+ |
// Prints help on the given switch. There should be no leading hyphens. Returns |
// true if the switch was found and help was printed. False means the switch is |
// unknown. |
@@ -161,6 +195,10 @@ int RunHelp(const std::vector<std::string>& args) { |
} |
// Random other topics. |
+ if (what == "all") { |
+ PrintAllHelp(); |
+ return 0; |
+ } |
if (what == "buildargs") { |
PrintLongHelp(kBuildArgs_Help); |
return 0; |