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

Unified Diff: tools/gn/command_help.cc

Issue 1021923002: Add a "gn help all" option to GN to print all of the help at once. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@gn_help
Patch Set: Created 5 years, 9 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/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;
« 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