| Index: sdk/lib/_internal/pub/lib/src/command/upgrade.dart
|
| diff --git a/sdk/lib/_internal/pub/lib/src/command/upgrade.dart b/sdk/lib/_internal/pub/lib/src/command/upgrade.dart
|
| index 64a5b15496d12efda61fef41b40b31dd2dd7cfa8..1f4a191fab0963d606d99e4cc10d7434bd41be58 100644
|
| --- a/sdk/lib/_internal/pub/lib/src/command/upgrade.dart
|
| +++ b/sdk/lib/_internal/pub/lib/src/command/upgrade.dart
|
| @@ -22,20 +22,32 @@ class UpgradeCommand extends PubCommand {
|
| UpgradeCommand() {
|
| commandParser.addFlag('offline',
|
| help: 'Use cached packages instead of accessing the network.');
|
| +
|
| + commandParser.addFlag('dry-run', abbr: 'n', negatable: false,
|
| + help: 'Report what dependencies would change but do not change any.');
|
| }
|
|
|
| Future onRun() {
|
| var upgradeAll = commandOptions.rest.isEmpty;
|
| + var dryRun = commandOptions['dry-run'];
|
| return entrypoint.acquireDependencies(useLatest: commandOptions.rest,
|
| - upgradeAll: upgradeAll).then((numChanged) {
|
| - // TODO(rnystrom): Show a more detailed message about what was added,
|
| - // removed, modified, and/or upgraded?
|
| - if (numChanged == 0) {
|
| - log.message("No dependencies changed.");
|
| - } else if (numChanged == 1) {
|
| - log.message("Changed $numChanged dependency!");
|
| + upgradeAll: upgradeAll, dryRun: dryRun).then((numChanged) {
|
| + if (dryRun) {
|
| + if (numChanged == 0) {
|
| + log.message("No dependencies would change.");
|
| + } else if (numChanged == 1) {
|
| + log.message("Would change $numChanged dependency.");
|
| + } else {
|
| + log.message("Would change $numChanged dependencies.");
|
| + }
|
| } else {
|
| - log.message("Changed $numChanged dependencies!");
|
| + if (numChanged == 0) {
|
| + log.message("No dependencies changed.");
|
| + } else if (numChanged == 1) {
|
| + log.message("Changed $numChanged dependency!");
|
| + } else {
|
| + log.message("Changed $numChanged dependencies!");
|
| + }
|
| }
|
|
|
| if (isOffline) {
|
|
|