OLD | NEW |
1 // Copyright (c) 2013 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2013 The Chromium Authors. All rights reserved. |
2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
4 | 4 |
5 #include <algorithm> | 5 #include <algorithm> |
6 #include <iostream> | 6 #include <iostream> |
7 | 7 |
8 #include "tools/gn/args.h" | 8 #include "tools/gn/args.h" |
9 #include "tools/gn/commands.h" | 9 #include "tools/gn/commands.h" |
10 #include "tools/gn/err.h" | 10 #include "tools/gn/err.h" |
11 #include "tools/gn/functions.h" | 11 #include "tools/gn/functions.h" |
12 #include "tools/gn/input_conversion.h" | 12 #include "tools/gn/input_conversion.h" |
13 #include "tools/gn/pattern.h" | 13 #include "tools/gn/label_pattern.h" |
14 #include "tools/gn/setup.h" | 14 #include "tools/gn/setup.h" |
15 #include "tools/gn/standard_out.h" | 15 #include "tools/gn/standard_out.h" |
16 #include "tools/gn/substitution_writer.h" | 16 #include "tools/gn/substitution_writer.h" |
17 #include "tools/gn/variables.h" | 17 #include "tools/gn/variables.h" |
18 | 18 |
19 namespace commands { | 19 namespace commands { |
20 | 20 |
21 namespace { | 21 namespace { |
22 | 22 |
23 void PrintToplevelHelp() { | 23 void PrintToplevelHelp() { |
(...skipping 62 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
86 "for more details):\n"); | 86 "for more details):\n"); |
87 const variables::VariableInfoMap& target_vars = | 87 const variables::VariableInfoMap& target_vars = |
88 variables::GetTargetVariables(); | 88 variables::GetTargetVariables(); |
89 for (variables::VariableInfoMap::const_iterator i = target_vars.begin(); | 89 for (variables::VariableInfoMap::const_iterator i = target_vars.begin(); |
90 i != target_vars.end(); ++i) | 90 i != target_vars.end(); ++i) |
91 PrintShortHelp(i->second.help_short); | 91 PrintShortHelp(i->second.help_short); |
92 | 92 |
93 OutputString("\nOther help topics:\n"); | 93 OutputString("\nOther help topics:\n"); |
94 PrintShortHelp("buildargs: How build arguments work."); | 94 PrintShortHelp("buildargs: How build arguments work."); |
95 PrintShortHelp("dotfile: Info about the toplevel .gn file."); | 95 PrintShortHelp("dotfile: Info about the toplevel .gn file."); |
| 96 PrintShortHelp("label_pattern: Matching more than one label."); |
96 PrintShortHelp( | 97 PrintShortHelp( |
97 "input_conversion: Processing input from exec_script and read_file."); | 98 "input_conversion: Processing input from exec_script and read_file."); |
98 PrintShortHelp("patterns: How to use patterns."); | |
99 PrintShortHelp("source_expansion: Map sources to outputs for scripts."); | 99 PrintShortHelp("source_expansion: Map sources to outputs for scripts."); |
100 } | 100 } |
101 | 101 |
102 } // namespace | 102 } // namespace |
103 | 103 |
104 const char kHelp[] = "help"; | 104 const char kHelp[] = "help"; |
105 const char kHelp_HelpShort[] = | 105 const char kHelp_HelpShort[] = |
106 "help: Does what you think."; | 106 "help: Does what you think."; |
107 const char kHelp_Help[] = | 107 const char kHelp_Help[] = |
108 "gn help <anything>\n" | 108 "gn help <anything>\n" |
(...skipping 50 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
159 return 0; | 159 return 0; |
160 } | 160 } |
161 if (args[0] == "dotfile") { | 161 if (args[0] == "dotfile") { |
162 PrintLongHelp(kDotfile_Help); | 162 PrintLongHelp(kDotfile_Help); |
163 return 0; | 163 return 0; |
164 } | 164 } |
165 if (args[0] == "input_conversion") { | 165 if (args[0] == "input_conversion") { |
166 PrintLongHelp(kInputConversion_Help); | 166 PrintLongHelp(kInputConversion_Help); |
167 return 0; | 167 return 0; |
168 } | 168 } |
169 if (args[0] == "patterns") { | 169 if (args[0] == "label_pattern") { |
170 PrintLongHelp(kPattern_Help); | 170 PrintLongHelp(kLabelPattern_Help); |
171 return 0; | 171 return 0; |
172 } | 172 } |
173 if (args[0] == "source_expansion") { | 173 if (args[0] == "source_expansion") { |
174 PrintLongHelp(kSourceExpansion_Help); | 174 PrintLongHelp(kSourceExpansion_Help); |
175 return 0; | 175 return 0; |
176 } | 176 } |
177 | 177 |
178 // No help on this. | 178 // No help on this. |
179 Err(Location(), "No help on \"" + args[0] + "\".").PrintToStdout(); | 179 Err(Location(), "No help on \"" + args[0] + "\".").PrintToStdout(); |
180 RunHelp(std::vector<std::string>()); | 180 RunHelp(std::vector<std::string>()); |
181 return 1; | 181 return 1; |
182 } | 182 } |
183 | 183 |
184 } // namespace commands | 184 } // namespace commands |
OLD | NEW |