| 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 pub.command.global_activate; | 5 library pub.command.global_activate; |
| 6 | 6 |
| 7 import 'dart:async'; | 7 import 'dart:async'; |
| 8 | 8 |
| 9 import 'package:pub_semver/pub_semver.dart'; |
| 10 |
| 9 import '../command.dart'; | 11 import '../command.dart'; |
| 10 import '../utils.dart'; | 12 import '../utils.dart'; |
| 11 import '../version.dart'; | |
| 12 | 13 |
| 13 /// Handles the `global activate` pub command. | 14 /// Handles the `global activate` pub command. |
| 14 class GlobalActivateCommand extends PubCommand { | 15 class GlobalActivateCommand extends PubCommand { |
| 15 String get description => "Make a package's executables globally available."; | 16 String get description => "Make a package's executables globally available."; |
| 16 String get usage => "pub global activate <package...>"; | 17 String get usage => "pub global activate <package...>"; |
| 17 bool get takesArguments => true; | 18 bool get takesArguments => true; |
| 18 | 19 |
| 19 GlobalActivateCommand() { | 20 GlobalActivateCommand() { |
| 20 commandParser.addOption("source", | 21 commandParser.addOption("source", |
| 21 abbr: "s", | 22 abbr: "s", |
| (...skipping 71 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 93 case "path": | 94 case "path": |
| 94 var path = readArg("No package to activate given."); | 95 var path = readArg("No package to activate given."); |
| 95 validateNoExtraArgs(); | 96 validateNoExtraArgs(); |
| 96 return globals.activatePath(path, executables, | 97 return globals.activatePath(path, executables, |
| 97 overwriteBinStubs: overwrite); | 98 overwriteBinStubs: overwrite); |
| 98 } | 99 } |
| 99 | 100 |
| 100 throw "unreachable"; | 101 throw "unreachable"; |
| 101 } | 102 } |
| 102 } | 103 } |
| OLD | NEW |