| OLD | NEW |
| 1 // Copyright (c) 2012, the Dart project authors. Please see the AUTHORS file | 1 // Copyright (c) 2012, the Dart project authors. Please see the AUTHORS file |
| 2 // for details. All rights reserved. Use of this source code is governed by a | 2 // for details. All rights reserved. Use of this source code is governed by a |
| 3 // BSD-style license that can be found in the LICENSE file. | 3 // BSD-style license that can be found in the LICENSE file. |
| 4 | 4 |
| 5 #include <stdlib.h> | 5 #include <stdlib.h> |
| 6 #include <string.h> | 6 #include <string.h> |
| 7 #include <stdio.h> | 7 #include <stdio.h> |
| 8 | 8 |
| 9 #include "include/dart_api.h" | 9 #include "include/dart_api.h" |
| 10 #include "include/dart_tools_api.h" | 10 #include "include/dart_tools_api.h" |
| (...skipping 510 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 521 } | 521 } |
| 522 | 522 |
| 523 | 523 |
| 524 static bool ProcessShortSocketWriteOption(const char* arg, | 524 static bool ProcessShortSocketWriteOption(const char* arg, |
| 525 CommandLineOptions* vm_options) { | 525 CommandLineOptions* vm_options) { |
| 526 short_socket_write = true; | 526 short_socket_write = true; |
| 527 return true; | 527 return true; |
| 528 } | 528 } |
| 529 | 529 |
| 530 | 530 |
| 531 #if !defined(HOST_OS_MACOS) | |
| 532 extern const char* commandline_root_certs_file; | 531 extern const char* commandline_root_certs_file; |
| 533 extern const char* commandline_root_certs_cache; | 532 extern const char* commandline_root_certs_cache; |
| 534 | 533 |
| 535 static bool ProcessRootCertsFileOption(const char* arg, | 534 static bool ProcessRootCertsFileOption(const char* arg, |
| 536 CommandLineOptions* vm_options) { | 535 CommandLineOptions* vm_options) { |
| 537 ASSERT(arg != NULL); | 536 ASSERT(arg != NULL); |
| 538 if (*arg == '-') { | 537 if (*arg == '-') { |
| 539 return false; | 538 return false; |
| 540 } | 539 } |
| 541 if (commandline_root_certs_cache != NULL) { | 540 if (commandline_root_certs_cache != NULL) { |
| (...skipping 15 matching lines...) Expand all Loading... |
| 557 } | 556 } |
| 558 if (commandline_root_certs_file != NULL) { | 557 if (commandline_root_certs_file != NULL) { |
| 559 Log::PrintErr( | 558 Log::PrintErr( |
| 560 "Only one of --root-certs-file and --root-certs-cache " | 559 "Only one of --root-certs-file and --root-certs-cache " |
| 561 "may be specified"); | 560 "may be specified"); |
| 562 return false; | 561 return false; |
| 563 } | 562 } |
| 564 commandline_root_certs_cache = arg; | 563 commandline_root_certs_cache = arg; |
| 565 return true; | 564 return true; |
| 566 } | 565 } |
| 567 #endif // !defined(HOST_OS_MACOS) | |
| 568 | 566 |
| 569 | 567 |
| 570 static struct { | 568 static struct { |
| 571 const char* option_name; | 569 const char* option_name; |
| 572 bool (*process)(const char* option, CommandLineOptions* vm_options); | 570 bool (*process)(const char* option, CommandLineOptions* vm_options); |
| 573 } main_options[] = { | 571 } main_options[] = { |
| 574 // Standard options shared with dart2js. | 572 // Standard options shared with dart2js. |
| 575 {"-D", ProcessEnvironmentOption}, | 573 {"-D", ProcessEnvironmentOption}, |
| 576 {"-h", ProcessHelpOption}, | 574 {"-h", ProcessHelpOption}, |
| 577 {"--help", ProcessHelpOption}, | 575 {"--help", ProcessHelpOption}, |
| (...skipping 17 matching lines...) Expand all Loading... |
| 595 {"--snapshot-kind=", ProcessSnapshotKindOption}, | 593 {"--snapshot-kind=", ProcessSnapshotKindOption}, |
| 596 {"--snapshot-depfile=", ProcessSnapshotDepsFilenameOption}, | 594 {"--snapshot-depfile=", ProcessSnapshotDepsFilenameOption}, |
| 597 {"--use-blobs", ProcessUseBlobsOption}, | 595 {"--use-blobs", ProcessUseBlobsOption}, |
| 598 {"--save-feedback=", ProcessSaveFeedbackOption}, | 596 {"--save-feedback=", ProcessSaveFeedbackOption}, |
| 599 {"--load-feedback=", ProcessLoadFeedbackOption}, | 597 {"--load-feedback=", ProcessLoadFeedbackOption}, |
| 600 {"--trace-loading", ProcessTraceLoadingOption}, | 598 {"--trace-loading", ProcessTraceLoadingOption}, |
| 601 {"--hot-reload-test-mode", ProcessHotReloadTestModeOption}, | 599 {"--hot-reload-test-mode", ProcessHotReloadTestModeOption}, |
| 602 {"--hot-reload-rollback-test-mode", ProcessHotReloadRollbackTestModeOption}, | 600 {"--hot-reload-rollback-test-mode", ProcessHotReloadRollbackTestModeOption}, |
| 603 {"--short_socket_read", ProcessShortSocketReadOption}, | 601 {"--short_socket_read", ProcessShortSocketReadOption}, |
| 604 {"--short_socket_write", ProcessShortSocketWriteOption}, | 602 {"--short_socket_write", ProcessShortSocketWriteOption}, |
| 605 #if !defined(HOST_OS_MACOS) | |
| 606 {"--root-certs-file=", ProcessRootCertsFileOption}, | 603 {"--root-certs-file=", ProcessRootCertsFileOption}, |
| 607 {"--root-certs-cache=", ProcessRootCertsCacheOption}, | 604 {"--root-certs-cache=", ProcessRootCertsCacheOption}, |
| 608 #endif // !defined(HOST_OS_MACOS) | |
| 609 {NULL, NULL}}; | 605 {NULL, NULL}}; |
| 610 | 606 |
| 611 | 607 |
| 612 static bool ProcessMainOptions(const char* option, | 608 static bool ProcessMainOptions(const char* option, |
| 613 CommandLineOptions* vm_options) { | 609 CommandLineOptions* vm_options) { |
| 614 int i = 0; | 610 int i = 0; |
| 615 const char* name = main_options[0].option_name; | 611 const char* name = main_options[0].option_name; |
| 616 int option_length = strlen(option); | 612 int option_length = strlen(option); |
| 617 while (name != NULL) { | 613 while (name != NULL) { |
| 618 int length = strlen(name); | 614 int length = strlen(name); |
| (...skipping 1256 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1875 Platform::Exit(Process::GlobalExitCode()); | 1871 Platform::Exit(Process::GlobalExitCode()); |
| 1876 } | 1872 } |
| 1877 | 1873 |
| 1878 } // namespace bin | 1874 } // namespace bin |
| 1879 } // namespace dart | 1875 } // namespace dart |
| 1880 | 1876 |
| 1881 int main(int argc, char** argv) { | 1877 int main(int argc, char** argv) { |
| 1882 dart::bin::main(argc, argv); | 1878 dart::bin::main(argc, argv); |
| 1883 UNREACHABLE(); | 1879 UNREACHABLE(); |
| 1884 } | 1880 } |
| OLD | NEW |