| 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:async'; | 7 import 'dart:async'; |
| 8 import 'dart:io'; | 8 import 'dart:io'; |
| 9 | 9 |
| 10 import 'package:analysis_server/http_server.dart'; | 10 import 'package:analysis_server/http_server.dart'; |
| (...skipping 216 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 227 | 227 |
| 228 if (serve_http) { | 228 if (serve_http) { |
| 229 httpServer.serveHttp(port); | 229 httpServer.serveHttp(port); |
| 230 } | 230 } |
| 231 | 231 |
| 232 if (results[INTERNAL_PRINT_TO_CONSOLE]) { | 232 if (results[INTERNAL_PRINT_TO_CONSOLE]) { |
| 233 stdioServer.serveStdio().then((_) { | 233 stdioServer.serveStdio().then((_) { |
| 234 if (serve_http) { | 234 if (serve_http) { |
| 235 httpServer.close(); | 235 httpServer.close(); |
| 236 } | 236 } |
| 237 service.shutdown(); |
| 237 exit(0); | 238 exit(0); |
| 238 }); | 239 }); |
| 239 } else { | 240 } else { |
| 240 _capturePrints(() { | 241 _capturePrints(() { |
| 241 stdioServer.serveStdio().then((_) { | 242 stdioServer.serveStdio().then((_) { |
| 242 if (serve_http) { | 243 if (serve_http) { |
| 243 httpServer.close(); | 244 httpServer.close(); |
| 244 } | 245 } |
| 246 service.shutdown(); |
| 245 exit(0); | 247 exit(0); |
| 246 }); | 248 }); |
| 247 }, httpServer.recordPrint); | 249 }, httpServer.recordPrint); |
| 248 } | 250 } |
| 249 } | 251 } |
| 250 | 252 |
| 251 /** | 253 /** |
| 252 * Execute [callback], capturing any data it prints out and redirecting it to | 254 * Execute [callback], capturing any data it prints out and redirecting it to |
| 253 * the function [printHandler]. | 255 * the function [printHandler]. |
| 254 */ | 256 */ |
| (...skipping 10 matching lines...) Expand all Loading... |
| 265 /** | 267 /** |
| 266 * Print information about how to use the server. | 268 * Print information about how to use the server. |
| 267 */ | 269 */ |
| 268 void _printUsage(ArgParser parser) { | 270 void _printUsage(ArgParser parser) { |
| 269 print('Usage: $BINARY_NAME [flags]'); | 271 print('Usage: $BINARY_NAME [flags]'); |
| 270 print(''); | 272 print(''); |
| 271 print('Supported flags are:'); | 273 print('Supported flags are:'); |
| 272 print(parser.usage); | 274 print(parser.usage); |
| 273 } | 275 } |
| 274 } | 276 } |
| OLD | NEW |