| Index: pkg/analysis_server/lib/driver.dart
|
| diff --git a/pkg/analysis_server/lib/driver.dart b/pkg/analysis_server/lib/driver.dart
|
| index cd46bea567a8da3356c102a1d0bc5d956c60a941..911cbc66883a2ee7163b96bdd49b7075f4554b03 100644
|
| --- a/pkg/analysis_server/lib/driver.dart
|
| +++ b/pkg/analysis_server/lib/driver.dart
|
| @@ -60,26 +60,28 @@ class Driver {
|
| _printUsage(parser);
|
| return;
|
| }
|
| - if (results[PORT_OPTION] == null) {
|
| - print('Missing required port number');
|
| - print('');
|
| - _printUsage(parser);
|
| - exitCode = 1;
|
| - return;
|
| + int port;
|
| + bool serve_http = false;
|
| + if (results[PORT_OPTION] != null) {
|
| + serve_http = true;
|
| + try {
|
| + port = int.parse(results[PORT_OPTION]);
|
| + } on FormatException {
|
| + print('Invalid port number: ${results[PORT_OPTION]}');
|
| + print('');
|
| + _printUsage(parser);
|
| + exitCode = 1;
|
| + return;
|
| + }
|
| }
|
|
|
| - try {
|
| - int port = int.parse(results[PORT_OPTION]);
|
| + if (serve_http) {
|
| httpServer.serveHttp(port);
|
| - } on FormatException {
|
| - print('Invalid port number: ${results[PORT_OPTION]}');
|
| - print('');
|
| - _printUsage(parser);
|
| - exitCode = 1;
|
| - return;
|
| }
|
| stdioServer.serveStdio().then((_) {
|
| - httpServer.close();
|
| + if (serve_http) {
|
| + httpServer.close();
|
| + }
|
| });
|
| }
|
|
|
|
|