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 import 'dart:async'; | 5 import 'dart:async'; |
6 import 'dart:io'; | 6 import 'dart:io'; |
7 | 7 |
8 import 'package:args/args.dart'; | 8 import 'package:args/args.dart'; |
9 import 'package:analysis_server/src/analysis_manager.dart'; | 9 import 'package:analysis_server/src/analysis_manager.dart'; |
10 | 10 |
(...skipping 60 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
71 Future run() { | 71 Future run() { |
72 return new Future(start).then(analyze).whenComplete(stop); | 72 return new Future(start).then(analyze).whenComplete(stop); |
73 } | 73 } |
74 | 74 |
75 /** | 75 /** |
76 * Parse the command line arguments to determine the application to be | 76 * Parse the command line arguments to determine the application to be |
77 * analyzed, then launch an analysis server. | 77 * analyzed, then launch an analysis server. |
78 * Return `null` if the command line arguments are invalid. | 78 * Return `null` if the command line arguments are invalid. |
79 */ | 79 */ |
80 Future<AnalysisManager> start() { | 80 Future<AnalysisManager> start() { |
81 var parser = new ArgParser(); | 81 ArgParser parser = new ArgParser(); |
82 parser.addOption( | 82 parser.addOption( |
83 DART_SDK_OPTION, | 83 DART_SDK_OPTION, |
84 help: '[sdkPath] path to Dart SDK'); | 84 help: '[sdkPath] path to Dart SDK'); |
85 parser.addFlag(HELP_OPTION, | 85 parser.addFlag(HELP_OPTION, |
86 help: 'print this help message without starting analysis', | 86 help: 'print this help message without starting analysis', |
87 defaultsTo: false, | 87 defaultsTo: false, |
88 negatable: false); | 88 negatable: false); |
89 parser.addOption( | 89 parser.addOption( |
90 SERVER_OPTION, | 90 SERVER_OPTION, |
91 help: '[serverUrl] use an analysis server thats already running'); | 91 help: '[serverUrl] use an analysis server thats already running'); |
(...skipping 84 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
176 /** | 176 /** |
177 * Print information about how to use the server. | 177 * Print information about how to use the server. |
178 */ | 178 */ |
179 void printUsage(ArgParser parser) { | 179 void printUsage(ArgParser parser) { |
180 print('Usage: $BINARY_NAME [flags] <application_directory>'); | 180 print('Usage: $BINARY_NAME [flags] <application_directory>'); |
181 print(''); | 181 print(''); |
182 print('Supported flags are:'); | 182 print('Supported flags are:'); |
183 print(parser.getUsage()); | 183 print(parser.getUsage()); |
184 } | 184 } |
185 } | 185 } |
OLD | NEW |