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 <stddef.h> | 5 #include <stddef.h> |
6 | 6 |
7 #include <algorithm> | 7 #include <algorithm> |
8 #include <set> | 8 #include <set> |
9 #include <sstream> | 9 #include <sstream> |
10 | 10 |
(...skipping 441 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
452 return 1; | 452 return 1; |
453 | 453 |
454 std::string what_to_print; | 454 std::string what_to_print; |
455 if (args.size() == 3) | 455 if (args.size() == 3) |
456 what_to_print = args[2]; | 456 what_to_print = args[2]; |
457 | 457 |
458 bool json = cmdline->GetSwitchValueASCII("format") == "json"; | 458 bool json = cmdline->GetSwitchValueASCII("format") == "json"; |
459 | 459 |
460 if (json) { | 460 if (json) { |
461 // Convert all targets/configs to JSON, serialize and print them | 461 // Convert all targets/configs to JSON, serialize and print them |
462 auto res = base::WrapUnique(new base::DictionaryValue()); | 462 auto res = base::MakeUnique<base::DictionaryValue>(); |
463 if (!target_matches.empty()) { | 463 if (!target_matches.empty()) { |
464 for (const auto* target : target_matches) { | 464 for (const auto* target : target_matches) { |
465 res->Set(target->label().GetUserVisibleName( | 465 res->Set(target->label().GetUserVisibleName( |
466 target->settings()->default_toolchain_label()), | 466 target->settings()->default_toolchain_label()), |
467 DescBuilder::DescriptionForTarget( | 467 DescBuilder::DescriptionForTarget( |
468 target, what_to_print, cmdline->HasSwitch(kAll), | 468 target, what_to_print, cmdline->HasSwitch(kAll), |
469 cmdline->HasSwitch(kTree), cmdline->HasSwitch(kBlame))); | 469 cmdline->HasSwitch(kTree), cmdline->HasSwitch(kBlame))); |
470 } | 470 } |
471 } else if (!config_matches.empty()) { | 471 } else if (!config_matches.empty()) { |
472 for (const auto* config : config_matches) { | 472 for (const auto* config : config_matches) { |
(...skipping 27 matching lines...) Expand all Loading... |
500 | 500 |
501 if (!PrintConfig(config, what_to_print, !multiple_outputs)) | 501 if (!PrintConfig(config, what_to_print, !multiple_outputs)) |
502 return 1; | 502 return 1; |
503 } | 503 } |
504 } | 504 } |
505 | 505 |
506 return 0; | 506 return 0; |
507 } | 507 } |
508 | 508 |
509 } // namespace commands | 509 } // namespace commands |
OLD | NEW |