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