| Index: sdk/lib/_internal/pub_generated/lib/src/command/global_activate.dart
|
| diff --git a/sdk/lib/_internal/pub/lib/src/command/global_activate.dart b/sdk/lib/_internal/pub_generated/lib/src/command/global_activate.dart
|
| similarity index 80%
|
| copy from sdk/lib/_internal/pub/lib/src/command/global_activate.dart
|
| copy to sdk/lib/_internal/pub_generated/lib/src/command/global_activate.dart
|
| index 8448af58e84ce72f61a0b730b6d3784ae7f1e9c1..c6a2e22a7329a34936015972b886c95e59bca3c9 100644
|
| --- a/sdk/lib/_internal/pub/lib/src/command/global_activate.dart
|
| +++ b/sdk/lib/_internal/pub_generated/lib/src/command/global_activate.dart
|
| @@ -1,57 +1,41 @@
|
| -// Copyright (c) 2014, the Dart project authors. Please see the AUTHORS file
|
| -// for details. All rights reserved. Use of this source code is governed by a
|
| -// BSD-style license that can be found in the LICENSE file.
|
| -
|
| library pub.command.global_activate;
|
| -
|
| import 'dart:async';
|
| -
|
| import '../command.dart';
|
| import '../utils.dart';
|
| import '../version.dart';
|
| -
|
| -/// Handles the `global activate` pub command.
|
| class GlobalActivateCommand extends PubCommand {
|
| String get description => "Make a package's executables globally available.";
|
| String get usage => "pub global activate <package...>";
|
| bool get takesArguments => true;
|
| -
|
| GlobalActivateCommand() {
|
| - commandParser.addOption("source",
|
| + commandParser.addOption(
|
| + "source",
|
| abbr: "s",
|
| help: "The source used to find the package.",
|
| allowed: ["git", "hosted", "path"],
|
| defaultsTo: "hosted");
|
| }
|
| -
|
| Future onRun() {
|
| var args = commandOptions.rest;
|
| -
|
| readArg([String error]) {
|
| if (args.isEmpty) usageError(error);
|
| var arg = args.first;
|
| args = args.skip(1);
|
| return arg;
|
| }
|
| -
|
| validateNoExtraArgs() {
|
| if (args.isEmpty) return;
|
| var unexpected = args.map((arg) => '"$arg"');
|
| var arguments = pluralize("argument", unexpected.length);
|
| usageError("Unexpected $arguments ${toSentence(unexpected)}.");
|
| }
|
| -
|
| switch (commandOptions["source"]) {
|
| case "git":
|
| var repo = readArg("No Git repository given.");
|
| - // TODO(rnystrom): Allow passing in a Git ref too.
|
| validateNoExtraArgs();
|
| return globals.activateGit(repo);
|
| -
|
| case "hosted":
|
| var package = readArg("No package to activate given.");
|
| -
|
| - // Parse the version constraint, if there is one.
|
| var constraint = VersionConstraint.any;
|
| if (args.isNotEmpty) {
|
| try {
|
| @@ -60,16 +44,13 @@ class GlobalActivateCommand extends PubCommand {
|
| usageError(error.message);
|
| }
|
| }
|
| -
|
| validateNoExtraArgs();
|
| return globals.activateHosted(package, constraint);
|
| -
|
| case "path":
|
| var path = readArg("No package to activate given.");
|
| validateNoExtraArgs();
|
| return globals.activatePath(path);
|
| }
|
| -
|
| throw "unreachable";
|
| }
|
| }
|
|
|