| OLD | NEW |
| 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 <string> | 5 #include <string> |
| 6 #include <vector> | 6 #include <vector> |
| 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 406 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 417 if (status != courgette::OK) Problem("-applybsdiff failed."); | 417 if (status != courgette::OK) Problem("-applybsdiff failed."); |
| 418 | 418 |
| 419 WriteSinkToFile(&new_stream, new_file); | 419 WriteSinkToFile(&new_stream, new_file); |
| 420 } | 420 } |
| 421 | 421 |
| 422 int main(int argc, const char* argv[]) { | 422 int main(int argc, const char* argv[]) { |
| 423 base::AtExitManager at_exit_manager; | 423 base::AtExitManager at_exit_manager; |
| 424 CommandLine::Init(argc, argv); | 424 CommandLine::Init(argc, argv); |
| 425 const CommandLine& command_line = *CommandLine::ForCurrentProcess(); | 425 const CommandLine& command_line = *CommandLine::ForCurrentProcess(); |
| 426 | 426 |
| 427 (void)logging::InitLogging( | 427 logging::LoggingSettings settings; |
| 428 FILE_PATH_LITERAL("courgette.log"), | 428 settings.logging_dest = logging::LOG_TO_ALL; |
| 429 logging::LOG_TO_BOTH_FILE_AND_SYSTEM_DEBUG_LOG, | 429 settings.log_file = FILE_PATH_LITERAL("courgette.log"); |
| 430 logging::LOCK_LOG_FILE, | 430 (void)logging::InitLogging(settings); |
| 431 logging::APPEND_TO_OLD_LOG_FILE, | |
| 432 logging::DISABLE_DCHECK_FOR_NON_OFFICIAL_RELEASE_BUILDS); | |
| 433 logging::SetMinLogLevel(logging::LOG_VERBOSE); | 431 logging::SetMinLogLevel(logging::LOG_VERBOSE); |
| 434 | 432 |
| 435 bool cmd_sup = command_line.HasSwitch("supported"); | 433 bool cmd_sup = command_line.HasSwitch("supported"); |
| 436 bool cmd_dis = command_line.HasSwitch("dis"); | 434 bool cmd_dis = command_line.HasSwitch("dis"); |
| 437 bool cmd_asm = command_line.HasSwitch("asm"); | 435 bool cmd_asm = command_line.HasSwitch("asm"); |
| 438 bool cmd_disadj = command_line.HasSwitch("disadj"); | 436 bool cmd_disadj = command_line.HasSwitch("disadj"); |
| 439 bool cmd_make_patch = command_line.HasSwitch("gen"); | 437 bool cmd_make_patch = command_line.HasSwitch("gen"); |
| 440 bool cmd_apply_patch = command_line.HasSwitch("apply"); | 438 bool cmd_apply_patch = command_line.HasSwitch("apply"); |
| 441 bool cmd_make_bsdiff_patch = command_line.HasSwitch("genbsdiff"); | 439 bool cmd_make_bsdiff_patch = command_line.HasSwitch("genbsdiff"); |
| 442 bool cmd_apply_bsdiff_patch = command_line.HasSwitch("applybsdiff"); | 440 bool cmd_apply_bsdiff_patch = command_line.HasSwitch("applybsdiff"); |
| (...skipping 61 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 504 UsageProblem("-gen1[au] <old_file> <new_file> <patch_files_root>"); | 502 UsageProblem("-gen1[au] <old_file> <new_file> <patch_files_root>"); |
| 505 DisassembleAdjustDiff(values[0], values[1], values[2], | 503 DisassembleAdjustDiff(values[0], values[1], values[2], |
| 506 cmd_spread_1_adjusted); | 504 cmd_spread_1_adjusted); |
| 507 } else { | 505 } else { |
| 508 UsageProblem("No operation specified"); | 506 UsageProblem("No operation specified"); |
| 509 } | 507 } |
| 510 } | 508 } |
| 511 | 509 |
| 512 return 0; | 510 return 0; |
| 513 } | 511 } |
| OLD | NEW |