| OLD | NEW |
| 1 // Copyright (c) 2014, the Dart project authors. Please see the AUTHORS file | 1 // Copyright (c) 2014, 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 library driver; | 5 library driver; |
| 6 | 6 |
| 7 import 'dart:io'; | 7 import 'dart:io'; |
| 8 | 8 |
| 9 import 'package:analysis_server/http_server.dart'; | 9 import 'package:analysis_server/http_server.dart'; |
| 10 import 'package:analysis_server/src/socket_server.dart'; | 10 import 'package:analysis_server/src/socket_server.dart'; |
| (...skipping 60 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 71 try { | 71 try { |
| 72 int port = int.parse(results[PORT_OPTION]); | 72 int port = int.parse(results[PORT_OPTION]); |
| 73 httpServer.serveHttp(port); | 73 httpServer.serveHttp(port); |
| 74 } on FormatException { | 74 } on FormatException { |
| 75 print('Invalid port number: ${results[PORT_OPTION]}'); | 75 print('Invalid port number: ${results[PORT_OPTION]}'); |
| 76 print(''); | 76 print(''); |
| 77 _printUsage(parser); | 77 _printUsage(parser); |
| 78 exitCode = 1; | 78 exitCode = 1; |
| 79 return; | 79 return; |
| 80 } | 80 } |
| 81 stdioServer.serveStdio(); | 81 stdioServer.serveStdio().then((_) { |
| 82 httpServer.close(); |
| 83 }); |
| 82 } | 84 } |
| 83 | 85 |
| 84 /** | 86 /** |
| 85 * Print information about how to use the server. | 87 * Print information about how to use the server. |
| 86 */ | 88 */ |
| 87 void _printUsage(ArgParser parser) { | 89 void _printUsage(ArgParser parser) { |
| 88 print('Usage: $BINARY_NAME [flags]'); | 90 print('Usage: $BINARY_NAME [flags]'); |
| 89 print(''); | 91 print(''); |
| 90 print('Supported flags are:'); | 92 print('Supported flags are:'); |
| 91 print(parser.getUsage()); | 93 print(parser.getUsage()); |
| 92 } | 94 } |
| 93 } | 95 } |
| OLD | NEW |