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

Side by Side Diff: courgette/courgette_tool.cc

Issue 7352006: Rename CommandLine::GetArgs(), update callers. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Rename CommandLine::GetArgs(), update callers. Created 9 years, 5 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 unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « chrome/tools/profiles/generate_profile.cc ('k') | media/test/ffmpeg_tests/ffmpeg_tests.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2011 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 <vector> 5 #include <vector>
6 #include <string> 6 #include <string>
7 7
8 #include "base/at_exit.h" 8 #include "base/at_exit.h"
9 #include "base/basictypes.h" 9 #include "base/basictypes.h"
10 #include "base/command_line.h" 10 #include "base/command_line.h"
(...skipping 401 matching lines...) Expand 10 before | Expand all | Expand 10 after
412 bool cmd_disadj = command_line.HasSwitch("disadj"); 412 bool cmd_disadj = command_line.HasSwitch("disadj");
413 bool cmd_make_patch = command_line.HasSwitch("gen"); 413 bool cmd_make_patch = command_line.HasSwitch("gen");
414 bool cmd_apply_patch = command_line.HasSwitch("apply"); 414 bool cmd_apply_patch = command_line.HasSwitch("apply");
415 bool cmd_make_bsdiff_patch = command_line.HasSwitch("genbsdiff"); 415 bool cmd_make_bsdiff_patch = command_line.HasSwitch("genbsdiff");
416 bool cmd_apply_bsdiff_patch = command_line.HasSwitch("applybsdiff"); 416 bool cmd_apply_bsdiff_patch = command_line.HasSwitch("applybsdiff");
417 bool cmd_spread_1_adjusted = command_line.HasSwitch("gen1a"); 417 bool cmd_spread_1_adjusted = command_line.HasSwitch("gen1a");
418 bool cmd_spread_1_unadjusted = command_line.HasSwitch("gen1u"); 418 bool cmd_spread_1_unadjusted = command_line.HasSwitch("gen1u");
419 419
420 // TODO(evanm): this whole file should use FilePaths instead of wstrings. 420 // TODO(evanm): this whole file should use FilePaths instead of wstrings.
421 std::vector<std::wstring> values; 421 std::vector<std::wstring> values;
422 for (size_t i = 0; i < command_line.args().size(); ++i) { 422 const CommandLine::StringVector& args = command_line.GetArgs();
423 for (size_t i = 0; i < args.size(); ++i) {
423 #if defined(OS_WIN) 424 #if defined(OS_WIN)
424 values.push_back(command_line.args()[i]); 425 values.push_back(args[i]);
425 #else 426 #else
426 values.push_back(ASCIIToWide(command_line.args()[i])); 427 values.push_back(ASCIIToWide(args[i]));
427 #endif 428 #endif
428 } 429 }
429 430
430 // '-repeat=N' is for debugging. Running many iterations can reveal leaks and 431 // '-repeat=N' is for debugging. Running many iterations can reveal leaks and
431 // bugs in cleanup. 432 // bugs in cleanup.
432 int repeat_count = 1; 433 int repeat_count = 1;
433 std::string repeat_switch = command_line.GetSwitchValueASCII("repeat"); 434 std::string repeat_switch = command_line.GetSwitchValueASCII("repeat");
434 if (!repeat_switch.empty()) 435 if (!repeat_switch.empty())
435 if (!base::StringToInt(repeat_switch, &repeat_count)) 436 if (!base::StringToInt(repeat_switch, &repeat_count))
436 repeat_count = 1; 437 repeat_count = 1;
(...skipping 38 matching lines...) Expand 10 before | Expand all | Expand 10 after
475 } else if (cmd_spread_1_adjusted || cmd_spread_1_unadjusted) { 476 } else if (cmd_spread_1_adjusted || cmd_spread_1_unadjusted) {
476 if (values.size() != 3) 477 if (values.size() != 3)
477 UsageProblem("-gen1[au] <old_file> <new_file> <patch_files_root>"); 478 UsageProblem("-gen1[au] <old_file> <new_file> <patch_files_root>");
478 DisassembleAdjustDiff(values[0], values[1], values[2], 479 DisassembleAdjustDiff(values[0], values[1], values[2],
479 cmd_spread_1_adjusted); 480 cmd_spread_1_adjusted);
480 } else { 481 } else {
481 UsageProblem("No operation specified"); 482 UsageProblem("No operation specified");
482 } 483 }
483 } 484 }
484 } 485 }
OLDNEW
« no previous file with comments | « chrome/tools/profiles/generate_profile.cc ('k') | media/test/ffmpeg_tests/ffmpeg_tests.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698