OLD | NEW |
1 // Copyright (c) 2012, the Dart project authors. Please see the AUTHORS file | 1 // Copyright (c) 2012, 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 pub.command.get; | 5 library pub.command.get; |
6 | 6 |
7 import 'dart:async'; | 7 import 'dart:async'; |
8 | 8 |
9 import '../command.dart'; | 9 import '../command.dart'; |
| 10 import '../solver/version_solver.dart'; |
10 | 11 |
11 /// Handles the `get` pub command. | 12 /// Handles the `get` pub command. |
12 class GetCommand extends PubCommand { | 13 class GetCommand extends PubCommand { |
13 String get description => "Get the current package's dependencies."; | 14 String get description => "Get the current package's dependencies."; |
14 String get usage => "pub get"; | 15 String get usage => "pub get"; |
15 String get docUrl => "http://dartlang.org/tools/pub/cmd/pub-get.html"; | 16 String get docUrl => "http://dartlang.org/tools/pub/cmd/pub-get.html"; |
16 List<String> get aliases => const ["install"]; | 17 List<String> get aliases => const ["install"]; |
17 bool get isOffline => commandOptions["offline"]; | 18 bool get isOffline => commandOptions["offline"]; |
18 | 19 |
19 GetCommand() { | 20 GetCommand() { |
20 commandParser.addFlag('offline', | 21 commandParser.addFlag('offline', |
21 help: 'Use cached packages instead of accessing the network.'); | 22 help: 'Use cached packages instead of accessing the network.'); |
22 | 23 |
23 commandParser.addFlag('dry-run', abbr: 'n', negatable: false, | 24 commandParser.addFlag('dry-run', abbr: 'n', negatable: false, |
24 help: "Report what dependencies would change but don't change any."); | 25 help: "Report what dependencies would change but don't change any."); |
25 } | 26 } |
26 | 27 |
27 Future onRun() { | 28 Future onRun() { |
28 return entrypoint.acquireDependencies(dryRun: commandOptions['dry-run']); | 29 return entrypoint.acquireDependencies(SolveType.GET, |
| 30 dryRun: commandOptions['dry-run']); |
29 } | 31 } |
30 } | 32 } |
OLD | NEW |