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 import '../solver/version_solver.dart'; |
11 | 11 |
12 /// Handles the `get` pub command. | 12 /// Handles the `get` pub command. |
13 class GetCommand extends PubCommand { | 13 class GetCommand extends PubCommand { |
14 String get name => "get"; | 14 String get name => "get"; |
15 String get description => "Get the current package's dependencies."; | 15 String get description => "Get the current package's dependencies."; |
16 String get invocation => "pub get"; | 16 String get invocation => "pub get"; |
17 String get docUrl => "http://dartlang.org/tools/pub/cmd/pub-get.html"; | 17 String get docUrl => "http://dartlang.org/tools/pub/cmd/pub-get.html"; |
18 List<String> get aliases => const ["install"]; | 18 List<String> get aliases => const ["install"]; |
19 bool get isOffline => argResults["offline"]; | 19 bool get isOffline => argResults["offline"]; |
20 | 20 |
21 GetCommand() { | 21 GetCommand() { |
22 argParser.addFlag('offline', | 22 argParser.addFlag( |
| 23 'offline', |
23 help: 'Use cached packages instead of accessing the network.'); | 24 help: 'Use cached packages instead of accessing the network.'); |
24 | 25 |
25 argParser.addFlag('dry-run', abbr: 'n', negatable: false, | 26 argParser.addFlag( |
| 27 'dry-run', |
| 28 abbr: 'n', |
| 29 negatable: false, |
26 help: "Report what dependencies would change but don't change any."); | 30 help: "Report what dependencies would change but don't change any."); |
27 } | 31 } |
28 | 32 |
29 Future run() { | 33 Future run() { |
30 return entrypoint.acquireDependencies(SolveType.GET, | 34 return entrypoint.acquireDependencies( |
| 35 SolveType.GET, |
31 dryRun: argResults['dry-run']); | 36 dryRun: argResults['dry-run']); |
32 } | 37 } |
33 } | 38 } |
OLD | NEW |