| 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 473 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 484 } | 484 } |
| 485 | 485 |
| 486 | 486 |
| 487 static bool ProcessShortSocketWriteOption(const char* arg, | 487 static bool ProcessShortSocketWriteOption(const char* arg, |
| 488 CommandLineOptions* vm_options) { | 488 CommandLineOptions* vm_options) { |
| 489 short_socket_write = true; | 489 short_socket_write = true; |
| 490 return true; | 490 return true; |
| 491 } | 491 } |
| 492 | 492 |
| 493 | 493 |
| 494 #if !defined(TARGET_OS_MACOS) | 494 #if !defined(HOST_OS_MACOS) |
| 495 extern const char* commandline_root_certs_file; | 495 extern const char* commandline_root_certs_file; |
| 496 extern const char* commandline_root_certs_cache; | 496 extern const char* commandline_root_certs_cache; |
| 497 | 497 |
| 498 static bool ProcessRootCertsFileOption(const char* arg, | 498 static bool ProcessRootCertsFileOption(const char* arg, |
| 499 CommandLineOptions* vm_options) { | 499 CommandLineOptions* vm_options) { |
| 500 ASSERT(arg != NULL); | 500 ASSERT(arg != NULL); |
| 501 if (*arg == '-') { | 501 if (*arg == '-') { |
| 502 return false; | 502 return false; |
| 503 } | 503 } |
| 504 if (commandline_root_certs_cache != NULL) { | 504 if (commandline_root_certs_cache != NULL) { |
| (...skipping 15 matching lines...) Expand all Loading... |
| 520 } | 520 } |
| 521 if (commandline_root_certs_file != NULL) { | 521 if (commandline_root_certs_file != NULL) { |
| 522 Log::PrintErr( | 522 Log::PrintErr( |
| 523 "Only one of --root-certs-file and --root-certs-cache " | 523 "Only one of --root-certs-file and --root-certs-cache " |
| 524 "may be specified"); | 524 "may be specified"); |
| 525 return false; | 525 return false; |
| 526 } | 526 } |
| 527 commandline_root_certs_cache = arg; | 527 commandline_root_certs_cache = arg; |
| 528 return true; | 528 return true; |
| 529 } | 529 } |
| 530 #endif // !defined(TARGET_OS_MACOS) | 530 #endif // !defined(HOST_OS_MACOS) |
| 531 | 531 |
| 532 | 532 |
| 533 static struct { | 533 static struct { |
| 534 const char* option_name; | 534 const char* option_name; |
| 535 bool (*process)(const char* option, CommandLineOptions* vm_options); | 535 bool (*process)(const char* option, CommandLineOptions* vm_options); |
| 536 } main_options[] = { | 536 } main_options[] = { |
| 537 // Standard options shared with dart2js. | 537 // Standard options shared with dart2js. |
| 538 {"-D", ProcessEnvironmentOption}, | 538 {"-D", ProcessEnvironmentOption}, |
| 539 {"-h", ProcessHelpOption}, | 539 {"-h", ProcessHelpOption}, |
| 540 {"--help", ProcessHelpOption}, | 540 {"--help", ProcessHelpOption}, |
| (...skipping 13 matching lines...) Expand all Loading... |
| 554 {"--snapshot=", ProcessSnapshotFilenameOption}, | 554 {"--snapshot=", ProcessSnapshotFilenameOption}, |
| 555 {"--snapshot-kind=", ProcessSnapshotKindOption}, | 555 {"--snapshot-kind=", ProcessSnapshotKindOption}, |
| 556 {"--use-blobs", ProcessUseBlobsOption}, | 556 {"--use-blobs", ProcessUseBlobsOption}, |
| 557 {"--save-feedback=", ProcessSaveFeedbackOption}, | 557 {"--save-feedback=", ProcessSaveFeedbackOption}, |
| 558 {"--load-feedback=", ProcessLoadFeedbackOption}, | 558 {"--load-feedback=", ProcessLoadFeedbackOption}, |
| 559 {"--trace-loading", ProcessTraceLoadingOption}, | 559 {"--trace-loading", ProcessTraceLoadingOption}, |
| 560 {"--hot-reload-test-mode", ProcessHotReloadTestModeOption}, | 560 {"--hot-reload-test-mode", ProcessHotReloadTestModeOption}, |
| 561 {"--hot-reload-rollback-test-mode", ProcessHotReloadRollbackTestModeOption}, | 561 {"--hot-reload-rollback-test-mode", ProcessHotReloadRollbackTestModeOption}, |
| 562 {"--short_socket_read", ProcessShortSocketReadOption}, | 562 {"--short_socket_read", ProcessShortSocketReadOption}, |
| 563 {"--short_socket_write", ProcessShortSocketWriteOption}, | 563 {"--short_socket_write", ProcessShortSocketWriteOption}, |
| 564 #if !defined(TARGET_OS_MACOS) | 564 #if !defined(HOST_OS_MACOS) |
| 565 {"--root-certs-file=", ProcessRootCertsFileOption}, | 565 {"--root-certs-file=", ProcessRootCertsFileOption}, |
| 566 {"--root-certs-cache=", ProcessRootCertsCacheOption}, | 566 {"--root-certs-cache=", ProcessRootCertsCacheOption}, |
| 567 #endif // !defined(TARGET_OS_MACOS) | 567 #endif // !defined(HOST_OS_MACOS) |
| 568 {NULL, NULL}}; | 568 {NULL, NULL}}; |
| 569 | 569 |
| 570 | 570 |
| 571 static bool ProcessMainOptions(const char* option, | 571 static bool ProcessMainOptions(const char* option, |
| 572 CommandLineOptions* vm_options) { | 572 CommandLineOptions* vm_options) { |
| 573 int i = 0; | 573 int i = 0; |
| 574 const char* name = main_options[0].option_name; | 574 const char* name = main_options[0].option_name; |
| 575 int option_length = strlen(option); | 575 int option_length = strlen(option); |
| 576 while (name != NULL) { | 576 while (name != NULL) { |
| 577 int length = strlen(name); | 577 int length = strlen(name); |
| (...skipping 531 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1109 " <file_name> specifies the file into which the snapshot is written\n" | 1109 " <file_name> specifies the file into which the snapshot is written\n" |
| 1110 "--version\n" | 1110 "--version\n" |
| 1111 " Print the VM version.\n" | 1111 " Print the VM version.\n" |
| 1112 "\n" | 1112 "\n" |
| 1113 "--trace-loading\n" | 1113 "--trace-loading\n" |
| 1114 " enables tracing of library and script loading\n" | 1114 " enables tracing of library and script loading\n" |
| 1115 "\n" | 1115 "\n" |
| 1116 "--enable-vm-service[=<port>[/<bind-address>]]\n" | 1116 "--enable-vm-service[=<port>[/<bind-address>]]\n" |
| 1117 " enables the VM service and listens on specified port for connections\n" | 1117 " enables the VM service and listens on specified port for connections\n" |
| 1118 " (default port number is 8181, default bind address is localhost).\n" | 1118 " (default port number is 8181, default bind address is localhost).\n" |
| 1119 #if !defined(TARGET_OS_MACOS) | 1119 #if !defined(HOST_OS_MACOS) |
| 1120 "\n" | 1120 "\n" |
| 1121 "--root-certs-file=<path>\n" | 1121 "--root-certs-file=<path>\n" |
| 1122 " The path to a file containing the trusted root certificates to use for\n" | 1122 " The path to a file containing the trusted root certificates to use for\n" |
| 1123 " secure socket connections.\n" | 1123 " secure socket connections.\n" |
| 1124 "--root-certs-cache=<path>\n" | 1124 "--root-certs-cache=<path>\n" |
| 1125 " The path to a cache directory containing the trusted root certificates to\n" | 1125 " The path to a cache directory containing the trusted root certificates to\n" |
| 1126 " use for secure socket connections.\n" | 1126 " use for secure socket connections.\n" |
| 1127 #endif // !defined(TARGET_OS_MACOS) | 1127 #endif // !defined(HOST_OS_MACOS) |
| 1128 "\n" | 1128 "\n" |
| 1129 "The following options are only used for VM development and may\n" | 1129 "The following options are only used for VM development and may\n" |
| 1130 "be changed in any future version:\n"); | 1130 "be changed in any future version:\n"); |
| 1131 const char* print_flags = "--print_flags"; | 1131 const char* print_flags = "--print_flags"; |
| 1132 Dart_SetVMFlags(1, &print_flags); | 1132 Dart_SetVMFlags(1, &print_flags); |
| 1133 } | 1133 } |
| 1134 } | 1134 } |
| 1135 // clang-format on | 1135 // clang-format on |
| 1136 | 1136 |
| 1137 | 1137 |
| (...skipping 541 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1679 Platform::Exit(Process::GlobalExitCode()); | 1679 Platform::Exit(Process::GlobalExitCode()); |
| 1680 } | 1680 } |
| 1681 | 1681 |
| 1682 } // namespace bin | 1682 } // namespace bin |
| 1683 } // namespace dart | 1683 } // namespace dart |
| 1684 | 1684 |
| 1685 int main(int argc, char** argv) { | 1685 int main(int argc, char** argv) { |
| 1686 dart::bin::main(argc, argv); | 1686 dart::bin::main(argc, argv); |
| 1687 UNREACHABLE(); | 1687 UNREACHABLE(); |
| 1688 } | 1688 } |
| OLD | NEW |