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 <stdio.h> | 5 #include <stdio.h> |
6 #include <stdlib.h> | 6 #include <stdlib.h> |
7 | 7 |
8 #include <map> | 8 #include <map> |
9 | 9 |
10 #include "base/command_line.h" | 10 #include "base/command_line.h" |
(...skipping 304 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
315 " --args=<exact list of args to use>\n" | 315 " --args=<exact list of args to use>\n" |
316 "\n" | 316 "\n" |
317 "Examples\n" | 317 "Examples\n" |
318 " gn args out/Debug\n" | 318 " gn args out/Debug\n" |
319 " Opens an editor with the args for out/Debug.\n" | 319 " Opens an editor with the args for out/Debug.\n" |
320 "\n" | 320 "\n" |
321 " gn args out/Debug --list --short\n" | 321 " gn args out/Debug --list --short\n" |
322 " Prints all arguments with their default values for the out/Debug\n" | 322 " Prints all arguments with their default values for the out/Debug\n" |
323 " build.\n" | 323 " build.\n" |
324 "\n" | 324 "\n" |
325 " gn args out/Debug --list=cpu_arch\n" | 325 " gn args out/Debug --list=target_cpu\n" |
326 " Prints information about the \"cpu_arch\" argument for the out/Debug\n" | 326 " Prints information about the \"target_cpu\" argument for the " |
| 327 "out/Debug\n" |
327 " build.\n" | 328 " build.\n" |
328 "\n" | 329 "\n" |
329 " gn args --list --args=\"os=\\\"android\\\" enable_doom_melon=true\"\n" | 330 " gn args --list --args=\"os=\\\"android\\\" enable_doom_melon=true\"\n" |
330 " Prints all arguments with the default values for a build with the\n" | 331 " Prints all arguments with the default values for a build with the\n" |
331 " given arguments set (which may affect the values of other\n" | 332 " given arguments set (which may affect the values of other\n" |
332 " arguments).\n"; | 333 " arguments).\n"; |
333 | 334 |
334 int RunArgs(const std::vector<std::string>& args) { | 335 int RunArgs(const std::vector<std::string>& args) { |
335 if (args.size() != 1) { | 336 if (args.size() != 1) { |
336 Err(Location(), "Exactly one build dir needed.", | 337 Err(Location(), "Exactly one build dir needed.", |
337 "Usage: \"gn args <out_dir>\"\n" | 338 "Usage: \"gn args <out_dir>\"\n" |
338 "Or see \"gn help args\" for more variants.").PrintToStdout(); | 339 "Or see \"gn help args\" for more variants.").PrintToStdout(); |
339 return 1; | 340 return 1; |
340 } | 341 } |
341 | 342 |
342 if (base::CommandLine::ForCurrentProcess()->HasSwitch(kSwitchList)) | 343 if (base::CommandLine::ForCurrentProcess()->HasSwitch(kSwitchList)) |
343 return ListArgs(args[0]); | 344 return ListArgs(args[0]); |
344 return EditArgsFile(args[0]); | 345 return EditArgsFile(args[0]); |
345 } | 346 } |
346 | 347 |
347 } // namespace commands | 348 } // namespace commands |
OLD | NEW |