| Index: pkg/analysis_server/bin/dartdeps.dart
|
| diff --git a/pkg/analysis_server/bin/dartdeps.dart b/pkg/analysis_server/bin/dartdeps.dart
|
| index 15ea8c182166b86891f5b1f2102a5f4eec33e7bc..9282844c65f2a4e2796e106b0e2e2f027b89e3d9 100644
|
| --- a/pkg/analysis_server/bin/dartdeps.dart
|
| +++ b/pkg/analysis_server/bin/dartdeps.dart
|
| @@ -33,6 +33,11 @@ class _DartDependencyAnalyzer {
|
| static const BINARY_NAME = 'dartdeps';
|
|
|
| /**
|
| + * The name of the option used to specify the Dart SDK.
|
| + */
|
| + static const String DART_SDK_OPTION = 'dart-sdk';
|
| +
|
| + /**
|
| * The name of the option used to print usage information.
|
| */
|
| static const String HELP_OPTION = 'help';
|
| @@ -48,6 +53,11 @@ class _DartDependencyAnalyzer {
|
| final List<String> args;
|
|
|
| /**
|
| + * The path to the Dart SDK used during analysis.
|
| + */
|
| + String sdkPath;
|
| +
|
| + /**
|
| * The manager for the analysis server.
|
| */
|
| AnalysisManager manager;
|
| @@ -69,6 +79,9 @@ class _DartDependencyAnalyzer {
|
| */
|
| Future<AnalysisManager> start() {
|
| var parser = new ArgParser();
|
| + parser.addOption(
|
| + DART_SDK_OPTION,
|
| + help: '[sdkPath] path to Dart SDK');
|
| parser.addFlag(HELP_OPTION,
|
| help: 'print this help message without starting analysis',
|
| defaultsTo: false,
|
| @@ -92,6 +105,18 @@ class _DartDependencyAnalyzer {
|
| printUsage(parser);
|
| return null;
|
| }
|
| + sdkPath = results[DART_SDK_OPTION];
|
| + if (sdkPath is! String) {
|
| + print('Missing path to Dart SDK');
|
| + printUsage(parser);
|
| + return null;
|
| + }
|
| + Directory sdkDir = new Directory(sdkPath);
|
| + if (!sdkDir.existsSync()) {
|
| + print('Specified Dart SDK does not exist: $sdkPath');
|
| + printUsage(parser);
|
| + return null;
|
| + }
|
| if (results.rest.length == 0) {
|
| printUsage(parser);
|
| exitCode = 1;
|
|
|