| Index: dart/pkg/dart2js_incremental/lib/server.dart
|
| diff --git a/dart/pkg/dart2js_incremental/lib/server.dart b/dart/pkg/dart2js_incremental/lib/server.dart
|
| index a31c64d96400a511d1e8d276a3d349510653ed64..a0ed328fb674239adbe22b3fc98a316865a061ba 100644
|
| --- a/dart/pkg/dart2js_incremental/lib/server.dart
|
| +++ b/dart/pkg/dart2js_incremental/lib/server.dart
|
| @@ -15,6 +15,8 @@ import 'dart:convert' show
|
| JSON,
|
| UTF8;
|
|
|
| +import 'src/options.dart';
|
| +
|
| class Conversation {
|
| HttpRequest request;
|
| HttpResponse response;
|
| @@ -160,20 +162,16 @@ class Conversation {
|
| }
|
|
|
| main(List<String> arguments) {
|
| - if (arguments.length > 0) {
|
| - Conversation.documentRoot = Uri.base.resolve(arguments[0]);
|
| - }
|
| - var host = '127.0.0.1';
|
| - if (arguments.length > 1) {
|
| - host = arguments[1];
|
| - }
|
| - int port = 0;
|
| - if (arguments.length > 2) {
|
| - port = int.parse(arguments[2]);
|
| + Options options = Options.parse(arguments);
|
| + if (options == null) {
|
| + exit(1);
|
| }
|
| - if (arguments.length > 3) {
|
| - Conversation.packageRoot = Uri.base.resolve(arguments[4]);
|
| + if (!options.arguments.isEmpty) {
|
| + Conversation.documentRoot = Uri.base.resolve(options.arguments.single);
|
| }
|
| + Conversation.packageRoot = options.packageRoot;
|
| + String host = options.host;
|
| + int port = options.port;
|
| HttpServer.bind(host, port).then((HttpServer server) {
|
| print('HTTP server started on http://$host:${server.port}/');
|
| server.listen(Conversation.onRequest, onError: Conversation.onError);
|
|
|