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 <map> | 5 #include <map> |
6 #include <set> | 6 #include <set> |
7 | 7 |
8 #include "base/command_line.h" | 8 #include "base/command_line.h" |
9 #include "tools/gn/commands.h" | 9 #include "tools/gn/commands.h" |
10 #include "tools/gn/deps_iterator.h" | 10 #include "tools/gn/deps_iterator.h" |
(...skipping 269 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
280 " containing the given file as a source.\n"; | 280 " containing the given file as a source.\n"; |
281 | 281 |
282 int RunRefs(const std::vector<std::string>& args) { | 282 int RunRefs(const std::vector<std::string>& args) { |
283 if (args.size() != 2) { | 283 if (args.size() != 2) { |
284 Err(Location(), "You're holding it wrong.", | 284 Err(Location(), "You're holding it wrong.", |
285 "Usage: \"gn refs <build_dir> (<label_pattern>|<file>)\"") | 285 "Usage: \"gn refs <build_dir> (<label_pattern>|<file>)\"") |
286 .PrintToStdout(); | 286 .PrintToStdout(); |
287 return 1; | 287 return 1; |
288 } | 288 } |
289 | 289 |
290 const CommandLine* cmdline = CommandLine::ForCurrentProcess(); | 290 const base::CommandLine* cmdline = base::CommandLine::ForCurrentProcess(); |
291 bool tree = cmdline->HasSwitch("tree"); | 291 bool tree = cmdline->HasSwitch("tree"); |
292 bool all = cmdline->HasSwitch("all"); | 292 bool all = cmdline->HasSwitch("all"); |
293 bool all_toolchains = cmdline->HasSwitch("all-toolchains"); | 293 bool all_toolchains = cmdline->HasSwitch("all-toolchains"); |
294 bool files = cmdline->HasSwitch("files"); | 294 bool files = cmdline->HasSwitch("files"); |
295 | 295 |
296 Setup* setup = new Setup; | 296 Setup* setup = new Setup; |
297 setup->set_check_for_bad_items(false); | 297 setup->set_check_for_bad_items(false); |
298 if (!setup->DoSetup(args[0], false) || !setup->Run()) | 298 if (!setup->DoSetup(args[0], false) || !setup->Run()) |
299 return 1; | 299 return 1; |
300 | 300 |
(...skipping 77 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
378 results.insert(cur_dep->second); | 378 results.insert(cur_dep->second); |
379 } | 379 } |
380 } | 380 } |
381 OutputResultSet(results, files); | 381 OutputResultSet(results, files); |
382 } | 382 } |
383 | 383 |
384 return 0; | 384 return 0; |
385 } | 385 } |
386 | 386 |
387 } // namespace commands | 387 } // namespace commands |
OLD | NEW |