From 06e6ef10946071956cc7f2a9d89069cfd8770eaf Mon Sep 17 00:00:00 2001 From: Sigurd Meldgaard Date: Fri, 30 Aug 2024 13:33:12 +0000 Subject: [PATCH 1/5] `pub bump` command --- lib/src/command/bump.dart | 90 +++++++++++++++++++ lib/src/command_runner.dart | 2 + lib/src/pub_embeddable_command.dart | 2 + test/bump_test.dart | 53 +++++++++++ .../embedding/embedding_test/--help.txt | 1 + .../goldens/help_test/pub bump --help.txt | 17 ++++ 6 files changed, 165 insertions(+) create mode 100644 lib/src/command/bump.dart create mode 100644 test/bump_test.dart create mode 100644 test/testdata/goldens/help_test/pub bump --help.txt diff --git a/lib/src/command/bump.dart b/lib/src/command/bump.dart new file mode 100644 index 000000000..76a6be64e --- /dev/null +++ b/lib/src/command/bump.dart @@ -0,0 +1,90 @@ +// Copyright (c) 2024, 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. + +import 'dart:async'; + +import 'package:pub_semver/pub_semver.dart'; +import 'package:yaml_edit/yaml_edit.dart'; + +import '../command.dart'; +import '../io.dart'; +import '../log.dart' as log; + +class BumpCommand extends PubCommand { + @override + String get name => 'bump'; + @override + String get description => ''' +Increases the version number of the current package. +'''; + + BumpCommand() { + argParser.addFlag( + 'major', + negatable: false, + help: 'Increment the major version number (eg. 3.1.2 -> 4.0.0)', + ); + argParser.addFlag( + 'minor', + negatable: false, + help: 'Increment the minor version number (eg. 3.1.2 -> 3.2.0)', + ); + argParser.addFlag( + 'patch', + negatable: false, + help: 'Increment the patch version number (eg. 3.1.2 -> 3.1.3)', + ); + argParser.addFlag( + 'breaking', + negatable: false, + help: 'Increment to the next breaking version (eg. 0.1.2 -> 0.2.0)', + ); + argParser.addFlag( + 'dry-run', + abbr: 'n', + negatable: false, + help: "Report what would change but don't change anything.", + ); + } + + @override + Future runProtected() async { + final currentVersion = entrypoint.workPackage.pubspec.version; + final Version newVersion; + + final breaking = argResults.flag('breaking'); + final major = argResults.flag('major'); + final minor = argResults.flag('minor'); + final patch = argResults.flag('patch'); + final optionCount = + [breaking, major, minor, patch].fold(0, (p, v) => p + (v ? 1 : 0)); + if (optionCount != 1) { + usageException('Provide exactly one of the options ' + '`--breaking`, `--major`, `--minor` or `--patch`.'); + } + + if (breaking) { + newVersion = currentVersion.nextBreaking; + } else if (major) { + newVersion = currentVersion.nextMajor; + } else if (minor) { + newVersion = currentVersion.nextMinor; + } else if (patch) { + newVersion = currentVersion.nextPatch; + } else { + throw StateError('Should not be possible'); + } + + if (argResults.flag('dry-run')) { + log.message('Would update version from $currentVersion to $newVersion.'); + } else { + log.message('Updating version from $currentVersion to $newVersion.'); + final yamlEditor = + YamlEditor(readTextFile(entrypoint.workPackage.pubspecPath)); + + yamlEditor.update(['version'], newVersion.toString()); + writeTextFile(entrypoint.workPackage.pubspecPath, yamlEditor.toString()); + } + } +} diff --git a/lib/src/command_runner.dart b/lib/src/command_runner.dart index 03c724bfa..810d1a145 100644 --- a/lib/src/command_runner.dart +++ b/lib/src/command_runner.dart @@ -11,6 +11,7 @@ import 'package:path/path.dart' as p; import 'command.dart' show PubTopLevel, lineLength; import 'command/add.dart'; +import 'command/bump.dart'; import 'command/cache.dart'; import 'command/deps.dart'; import 'command/downgrade.dart'; @@ -139,6 +140,7 @@ class PubCommandRunner extends CommandRunner implements PubTopLevel { // When adding new commands be sure to also add them to // `pub_embeddable_command.dart`. addCommand(AddCommand()); + addCommand(BumpCommand()); addCommand(CacheCommand()); addCommand(DepsCommand()); addCommand(DowngradeCommand()); diff --git a/lib/src/pub_embeddable_command.dart b/lib/src/pub_embeddable_command.dart index a5fad5156..e36bb4229 100644 --- a/lib/src/pub_embeddable_command.dart +++ b/lib/src/pub_embeddable_command.dart @@ -5,6 +5,7 @@ import 'command.dart' show PubCommand, PubTopLevel; import 'command.dart'; import 'command/add.dart'; +import 'command/bump.dart'; import 'command/cache.dart'; import 'command/deps.dart'; import 'command/downgrade.dart'; @@ -69,6 +70,7 @@ class PubEmbeddableCommand extends PubCommand implements PubTopLevel { // // New commands should (most likely) be included in both lists. addSubcommand(AddCommand()); + addSubcommand(BumpCommand()); addSubcommand(CacheCommand()); addSubcommand(DepsCommand()); addSubcommand(DowngradeCommand()); diff --git a/test/bump_test.dart b/test/bump_test.dart new file mode 100644 index 000000000..192818f52 --- /dev/null +++ b/test/bump_test.dart @@ -0,0 +1,53 @@ +// Copyright (c) 2024, 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. + +import 'package:test/test.dart'; + +import 'descriptor.dart'; +import 'test_pub.dart'; + +void main() { + void testBump(String part, String from, String to) { + test('Bumps the $part version from $from to $to', () async { + await appDir(pubspec: {'version': from}).create(); + await runPub( + args: ['bump', part, '--dry-run'], + output: contains('Would update version from $from to $to.'), + ); + await runPub( + args: ['bump', part], + output: contains('Updating version from $from to $to.'), + ); + await appDir(pubspec: {'version': to}).validate(); + }); + } + + testBump('--major', '0.0.0', '1.0.0'); + testBump('--major', '1.2.3', '2.0.0'); + testBump('--minor', '0.1.1-dev+2', '0.2.0'); + testBump('--minor', '1.2.3', '1.3.0'); + testBump('--patch', '0.1.1-dev+2', '0.1.1'); + testBump('--patch', '0.1.1+2', '0.1.2'); + testBump('--patch', '1.2.3', '1.2.4'); + testBump('--breaking', '0.2.0', '0.3.0'); + testBump('--breaking', '1.2.3', '2.0.0'); + + test('Creates top-level version field if missing', () async { + await dir(appPath, [ + file('pubspec.yaml', ''' +name: my_app +'''), + ]).create(); + await runPub( + args: ['bump', '--breaking'], + output: contains('Updating version from 0.0.0 to 0.1.0'), + ); + await dir(appPath, [ + file('pubspec.yaml', ''' +name: my_app +version: 0.1.0 +'''), + ]).create(); + }); +} diff --git a/test/testdata/goldens/embedding/embedding_test/--help.txt b/test/testdata/goldens/embedding/embedding_test/--help.txt index 55eacc6be..16beaacbf 100644 --- a/test/testdata/goldens/embedding/embedding_test/--help.txt +++ b/test/testdata/goldens/embedding/embedding_test/--help.txt @@ -14,6 +14,7 @@ Usage: pub_command_runner pub [arguments...] Available subcommands: add Add dependencies to `pubspec.yaml`. + bump Increases the version number of the current package. cache Work with the system cache. deps Print package dependencies. downgrade Downgrade the current package's dependencies to oldest versions. diff --git a/test/testdata/goldens/help_test/pub bump --help.txt b/test/testdata/goldens/help_test/pub bump --help.txt new file mode 100644 index 000000000..3067f364b --- /dev/null +++ b/test/testdata/goldens/help_test/pub bump --help.txt @@ -0,0 +1,17 @@ +# GENERATED BY: test/help_test.dart + +## Section 0 +$ pub bump --help +Increases the version number of the current package. + + +Usage: pub bump [arguments...] +-h, --help Print this usage information. + --major Increment the major version number (eg. 3.1.2 -> 4.0.0) + --minor Increment the minor version number (eg. 3.1.2 -> 3.2.0) + --patch Increment the patch version number (eg. 3.1.2 -> 3.1.3) + --breaking Increment to the next breaking version (eg. 0.1.2 -> 0.2.0) +-n, --dry-run Report what would change but don't change anything. + +Run "pub help" to see global options. + From 5ff5b0ed1f8364c25a7a7bb8190e7c5b94feb761 Mon Sep 17 00:00:00 2001 From: Sigurd Meldgaard Date: Thu, 5 Sep 2024 10:42:02 +0000 Subject: [PATCH 2/5] Write diffs. -> subcommands --- lib/src/command/bump.dart | 152 +++++++++++------- test/bump_test.dart | 76 +++++++-- .../goldens/help_test/pub bump --help.txt | 15 +- 3 files changed, 167 insertions(+), 76 deletions(-) diff --git a/lib/src/command/bump.dart b/lib/src/command/bump.dart index 76a6be64e..da3852145 100644 --- a/lib/src/command/bump.dart +++ b/lib/src/command/bump.dart @@ -4,42 +4,22 @@ import 'dart:async'; +import 'package:collection/collection.dart'; import 'package:pub_semver/pub_semver.dart'; +import 'package:yaml/yaml.dart'; import 'package:yaml_edit/yaml_edit.dart'; import '../command.dart'; +import '../http.dart'; import '../io.dart'; import '../log.dart' as log; -class BumpCommand extends PubCommand { - @override - String get name => 'bump'; - @override - String get description => ''' -Increases the version number of the current package. -'''; +class BumpSubcommand extends PubCommand { + final String name; + final String description; - BumpCommand() { - argParser.addFlag( - 'major', - negatable: false, - help: 'Increment the major version number (eg. 3.1.2 -> 4.0.0)', - ); - argParser.addFlag( - 'minor', - negatable: false, - help: 'Increment the minor version number (eg. 3.1.2 -> 3.2.0)', - ); - argParser.addFlag( - 'patch', - negatable: false, - help: 'Increment the patch version number (eg. 3.1.2 -> 3.1.3)', - ); - argParser.addFlag( - 'breaking', - negatable: false, - help: 'Increment to the next breaking version (eg. 0.1.2 -> 0.2.0)', - ); + final Version Function(Version) updateVersion; + BumpSubcommand(this.name, this.description, this.updateVersion) { argParser.addFlag( 'dry-run', abbr: 'n', @@ -48,43 +28,103 @@ Increases the version number of the current package. ); } + String? _versionLines(YamlMap map, String text, prefix) { + final entry = map.nodes.entries + .firstWhereOrNull((e) => (e.key as YamlNode).value == 'version'); + if (entry == null) return null; + + final firstLine = (entry.key as YamlNode).span.start.line; + final lastLine = entry.value.span.end.line; + final lines = text.split('\n'); + return lines + .sublist(firstLine, lastLine + 1) + .map((x) => '$prefix$x') + .join('\n'); + } + @override Future runProtected() async { - final currentVersion = entrypoint.workPackage.pubspec.version; - final Version newVersion; + final pubspec = entrypoint.workPackage.pubspec; + final currentVersion = pubspec.version; - final breaking = argResults.flag('breaking'); - final major = argResults.flag('major'); - final minor = argResults.flag('minor'); - final patch = argResults.flag('patch'); - final optionCount = - [breaking, major, minor, patch].fold(0, (p, v) => p + (v ? 1 : 0)); - if (optionCount != 1) { - usageException('Provide exactly one of the options ' - '`--breaking`, `--major`, `--minor` or `--patch`.'); - } - - if (breaking) { - newVersion = currentVersion.nextBreaking; - } else if (major) { - newVersion = currentVersion.nextMajor; - } else if (minor) { - newVersion = currentVersion.nextMinor; - } else if (patch) { - newVersion = currentVersion.nextPatch; - } else { - throw StateError('Should not be possible'); - } + final newVersion = updateVersion(currentVersion); + final originalPubspecText = + readTextFile(entrypoint.workPackage.pubspecPath); + final yamlEditor = YamlEditor(originalPubspecText); + yamlEditor.update(['version'], newVersion.toString()); + final updatedPubspecText = yamlEditor.toString(); + final beforeText = _versionLines(pubspec.fields, originalPubspecText, '- '); + final afterText = _versionLines( + yamlEditor.parseAt([]) as YamlMap, + updatedPubspecText, + '+ ', + ); if (argResults.flag('dry-run')) { log.message('Would update version from $currentVersion to $newVersion.'); + log.message('Diff:'); + if (beforeText != null) { + log.message(beforeText); + } + if (afterText != null) { + log.message(afterText); + } } else { log.message('Updating version from $currentVersion to $newVersion.'); - final yamlEditor = - YamlEditor(readTextFile(entrypoint.workPackage.pubspecPath)); + log.message('Diff:'); - yamlEditor.update(['version'], newVersion.toString()); - writeTextFile(entrypoint.workPackage.pubspecPath, yamlEditor.toString()); + if (beforeText != null) { + log.message(beforeText); + } + if (afterText != null) { + log.message(afterText); + log.message('\nRemember to update `CHANGELOG.md` before publishing.'); + } + writeTextFile( + entrypoint.workPackage.pubspecPath, + yamlEditor.toString(), + ); } } } + +class BumpCommand extends PubCommand { + @override + String get name => 'bump'; + @override + String get description => ''' +Increases the version number of the current package. +'''; + + BumpCommand() { + addSubcommand( + BumpSubcommand( + 'major', + 'Increment the major version number (eg. 3.1.2 -> 4.0.0)', + (v) => v.nextMajor, + ), + ); + addSubcommand( + BumpSubcommand( + 'minor', + 'Increment the minor version number (eg. 3.1.2 -> 3.2.0)', + (v) => v.nextMinor, + ), + ); + addSubcommand( + BumpSubcommand( + 'patch', + 'Increment the patch version number (eg. 3.1.2 -> 3.1.3)', + (v) => v.nextPatch, + ), + ); + + addSubcommand( + BumpSubcommand( + 'breaking', + 'Increment to the next breaking version (eg. 0.1.2 -> 0.2.0)', + (v) => v.nextBreaking, + ), + ); + } +} diff --git a/test/bump_test.dart b/test/bump_test.dart index 192818f52..b558a5562 100644 --- a/test/bump_test.dart +++ b/test/bump_test.dart @@ -10,28 +10,50 @@ import 'test_pub.dart'; void main() { void testBump(String part, String from, String to) { test('Bumps the $part version from $from to $to', () async { - await appDir(pubspec: {'version': from}).create(); + await dir(appPath, [ + file( + 'pubspec.yaml', + ''' +name: myapp +version: $from # comment +environment: + sdk: $defaultSdkConstraint +''', + ), + ]).create(); await runPub( args: ['bump', part, '--dry-run'], - output: contains('Would update version from $from to $to.'), + output: ''' +Would update version from $from to $to. +Diff: +- version: $from # comment ++ version: $to # comment +''', ); await runPub( args: ['bump', part], - output: contains('Updating version from $from to $to.'), + output: ''' +Updating version from $from to $to. +Diff: +- version: $from # comment ++ version: $to # comment + +Remember to update `CHANGELOG.md` before publishing. + ''', ); await appDir(pubspec: {'version': to}).validate(); }); } - testBump('--major', '0.0.0', '1.0.0'); - testBump('--major', '1.2.3', '2.0.0'); - testBump('--minor', '0.1.1-dev+2', '0.2.0'); - testBump('--minor', '1.2.3', '1.3.0'); - testBump('--patch', '0.1.1-dev+2', '0.1.1'); - testBump('--patch', '0.1.1+2', '0.1.2'); - testBump('--patch', '1.2.3', '1.2.4'); - testBump('--breaking', '0.2.0', '0.3.0'); - testBump('--breaking', '1.2.3', '2.0.0'); + testBump('major', '0.0.0', '1.0.0'); + testBump('major', '1.2.3', '2.0.0'); + testBump('minor', '0.1.1-dev+2', '0.2.0'); + testBump('minor', '1.2.3', '1.3.0'); + testBump('patch', '0.1.1-dev+2', '0.1.1'); + testBump('patch', '0.1.1+2', '0.1.2'); + testBump('patch', '1.2.3', '1.2.4'); + testBump('breaking', '0.2.0', '0.3.0'); + testBump('breaking', '1.2.3', '2.0.0'); test('Creates top-level version field if missing', () async { await dir(appPath, [ @@ -40,14 +62,42 @@ name: my_app '''), ]).create(); await runPub( - args: ['bump', '--breaking'], + args: ['bump', 'breaking'], output: contains('Updating version from 0.0.0 to 0.1.0'), ); await dir(appPath, [ file('pubspec.yaml', ''' name: my_app version: 0.1.0 +'''), + ]).validate(); + }); + + test('Writes all lines of diff', () async { + await dir(appPath, [ + file('pubspec.yaml', ''' +name: my_app +version: >- + 1.0.0 '''), ]).create(); + await runPub( + args: ['bump', 'minor'], + output: allOf( + contains('Updating version from 1.0.0 to 1.1.0'), + contains(''' +Diff: +- version: >- +- 1.0.0 ++ version: 1.1.0 +'''), + ), + ); + await dir(appPath, [ + file('pubspec.yaml', ''' +name: my_app +version: 1.1.0 +'''), + ]).validate(); }); } diff --git a/test/testdata/goldens/help_test/pub bump --help.txt b/test/testdata/goldens/help_test/pub bump --help.txt index 3067f364b..a076958bf 100644 --- a/test/testdata/goldens/help_test/pub bump --help.txt +++ b/test/testdata/goldens/help_test/pub bump --help.txt @@ -5,13 +5,14 @@ $ pub bump --help Increases the version number of the current package. -Usage: pub bump [arguments...] --h, --help Print this usage information. - --major Increment the major version number (eg. 3.1.2 -> 4.0.0) - --minor Increment the minor version number (eg. 3.1.2 -> 3.2.0) - --patch Increment the patch version number (eg. 3.1.2 -> 3.1.3) - --breaking Increment to the next breaking version (eg. 0.1.2 -> 0.2.0) --n, --dry-run Report what would change but don't change anything. +Usage: pub bump [arguments...] +-h, --help Print this usage information. + +Available subcommands: + breaking Increment to the next breaking version (eg. 0.1.2 -> 0.2.0) + major Increment the major version number (eg. 3.1.2 -> 4.0.0) + minor Increment the minor version number (eg. 3.1.2 -> 3.2.0) + patch Increment the patch version number (eg. 3.1.2 -> 3.1.3) Run "pub help" to see global options. From 2f2869b09e79e9699dbc15797d2724ba59de2fe9 Mon Sep 17 00:00:00 2001 From: Sigurd Meldgaard Date: Thu, 5 Sep 2024 10:45:33 +0000 Subject: [PATCH 3/5] Lints --- lib/src/command/bump.dart | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/lib/src/command/bump.dart b/lib/src/command/bump.dart index da3852145..d01582ebc 100644 --- a/lib/src/command/bump.dart +++ b/lib/src/command/bump.dart @@ -10,12 +10,13 @@ import 'package:yaml/yaml.dart'; import 'package:yaml_edit/yaml_edit.dart'; import '../command.dart'; -import '../http.dart'; import '../io.dart'; import '../log.dart' as log; class BumpSubcommand extends PubCommand { + @override final String name; + @override final String description; final Version Function(Version) updateVersion; @@ -28,7 +29,7 @@ class BumpSubcommand extends PubCommand { ); } - String? _versionLines(YamlMap map, String text, prefix) { + String? _versionLines(YamlMap map, String text, String prefix) { final entry = map.nodes.entries .firstWhereOrNull((e) => (e.key as YamlNode).value == 'version'); if (entry == null) return null; From c37bf4ca190b5367ca58e6a3a8df418e0dac436b Mon Sep 17 00:00:00 2001 From: Sigurd Meldgaard Date: Thu, 5 Sep 2024 11:09:53 +0000 Subject: [PATCH 4/5] Missing goldens --- .../goldens/help_test/pub bump breaking --help.txt | 12 ++++++++++++ .../goldens/help_test/pub bump major --help.txt | 12 ++++++++++++ .../goldens/help_test/pub bump minor --help.txt | 12 ++++++++++++ .../goldens/help_test/pub bump patch --help.txt | 12 ++++++++++++ 4 files changed, 48 insertions(+) create mode 100644 test/testdata/goldens/help_test/pub bump breaking --help.txt create mode 100644 test/testdata/goldens/help_test/pub bump major --help.txt create mode 100644 test/testdata/goldens/help_test/pub bump minor --help.txt create mode 100644 test/testdata/goldens/help_test/pub bump patch --help.txt diff --git a/test/testdata/goldens/help_test/pub bump breaking --help.txt b/test/testdata/goldens/help_test/pub bump breaking --help.txt new file mode 100644 index 000000000..798fcc7a4 --- /dev/null +++ b/test/testdata/goldens/help_test/pub bump breaking --help.txt @@ -0,0 +1,12 @@ +# GENERATED BY: test/help_test.dart + +## Section 0 +$ pub bump breaking --help +Increment to the next breaking version (eg. 0.1.2 -> 0.2.0) + +Usage: pub bump breaking [arguments...] +-h, --help Print this usage information. +-n, --dry-run Report what would change but don't change anything. + +Run "pub help" to see global options. + diff --git a/test/testdata/goldens/help_test/pub bump major --help.txt b/test/testdata/goldens/help_test/pub bump major --help.txt new file mode 100644 index 000000000..8318e9bed --- /dev/null +++ b/test/testdata/goldens/help_test/pub bump major --help.txt @@ -0,0 +1,12 @@ +# GENERATED BY: test/help_test.dart + +## Section 0 +$ pub bump major --help +Increment the major version number (eg. 3.1.2 -> 4.0.0) + +Usage: pub bump major [arguments...] +-h, --help Print this usage information. +-n, --dry-run Report what would change but don't change anything. + +Run "pub help" to see global options. + diff --git a/test/testdata/goldens/help_test/pub bump minor --help.txt b/test/testdata/goldens/help_test/pub bump minor --help.txt new file mode 100644 index 000000000..202046f7e --- /dev/null +++ b/test/testdata/goldens/help_test/pub bump minor --help.txt @@ -0,0 +1,12 @@ +# GENERATED BY: test/help_test.dart + +## Section 0 +$ pub bump minor --help +Increment the minor version number (eg. 3.1.2 -> 3.2.0) + +Usage: pub bump minor [arguments...] +-h, --help Print this usage information. +-n, --dry-run Report what would change but don't change anything. + +Run "pub help" to see global options. + diff --git a/test/testdata/goldens/help_test/pub bump patch --help.txt b/test/testdata/goldens/help_test/pub bump patch --help.txt new file mode 100644 index 000000000..91abd22b5 --- /dev/null +++ b/test/testdata/goldens/help_test/pub bump patch --help.txt @@ -0,0 +1,12 @@ +# GENERATED BY: test/help_test.dart + +## Section 0 +$ pub bump patch --help +Increment the patch version number (eg. 3.1.2 -> 3.1.3) + +Usage: pub bump patch [arguments...] +-h, --help Print this usage information. +-n, --dry-run Report what would change but don't change anything. + +Run "pub help" to see global options. + From d49feb76abe161148066774099eb300e5225a104 Mon Sep 17 00:00:00 2001 From: Sigurd Meldgaard Date: Fri, 6 Sep 2024 07:59:04 +0000 Subject: [PATCH 5/5] Add comma --- lib/src/command/bump.dart | 2 +- test/testdata/goldens/help_test/pub bump breaking --help.txt | 2 +- test/testdata/goldens/help_test/pub bump major --help.txt | 2 +- test/testdata/goldens/help_test/pub bump minor --help.txt | 2 +- test/testdata/goldens/help_test/pub bump patch --help.txt | 2 +- 5 files changed, 5 insertions(+), 5 deletions(-) diff --git a/lib/src/command/bump.dart b/lib/src/command/bump.dart index d01582ebc..906ca2b13 100644 --- a/lib/src/command/bump.dart +++ b/lib/src/command/bump.dart @@ -25,7 +25,7 @@ class BumpSubcommand extends PubCommand { 'dry-run', abbr: 'n', negatable: false, - help: "Report what would change but don't change anything.", + help: "Report what would change, but don't change anything.", ); } diff --git a/test/testdata/goldens/help_test/pub bump breaking --help.txt b/test/testdata/goldens/help_test/pub bump breaking --help.txt index 798fcc7a4..d25b9f9b7 100644 --- a/test/testdata/goldens/help_test/pub bump breaking --help.txt +++ b/test/testdata/goldens/help_test/pub bump breaking --help.txt @@ -6,7 +6,7 @@ Increment to the next breaking version (eg. 0.1.2 -> 0.2.0) Usage: pub bump breaking [arguments...] -h, --help Print this usage information. --n, --dry-run Report what would change but don't change anything. +-n, --dry-run Report what would change, but don't change anything. Run "pub help" to see global options. diff --git a/test/testdata/goldens/help_test/pub bump major --help.txt b/test/testdata/goldens/help_test/pub bump major --help.txt index 8318e9bed..15937ad36 100644 --- a/test/testdata/goldens/help_test/pub bump major --help.txt +++ b/test/testdata/goldens/help_test/pub bump major --help.txt @@ -6,7 +6,7 @@ Increment the major version number (eg. 3.1.2 -> 4.0.0) Usage: pub bump major [arguments...] -h, --help Print this usage information. --n, --dry-run Report what would change but don't change anything. +-n, --dry-run Report what would change, but don't change anything. Run "pub help" to see global options. diff --git a/test/testdata/goldens/help_test/pub bump minor --help.txt b/test/testdata/goldens/help_test/pub bump minor --help.txt index 202046f7e..927d5c2a2 100644 --- a/test/testdata/goldens/help_test/pub bump minor --help.txt +++ b/test/testdata/goldens/help_test/pub bump minor --help.txt @@ -6,7 +6,7 @@ Increment the minor version number (eg. 3.1.2 -> 3.2.0) Usage: pub bump minor [arguments...] -h, --help Print this usage information. --n, --dry-run Report what would change but don't change anything. +-n, --dry-run Report what would change, but don't change anything. Run "pub help" to see global options. diff --git a/test/testdata/goldens/help_test/pub bump patch --help.txt b/test/testdata/goldens/help_test/pub bump patch --help.txt index 91abd22b5..057b66934 100644 --- a/test/testdata/goldens/help_test/pub bump patch --help.txt +++ b/test/testdata/goldens/help_test/pub bump patch --help.txt @@ -6,7 +6,7 @@ Increment the patch version number (eg. 3.1.2 -> 3.1.3) Usage: pub bump patch [arguments...] -h, --help Print this usage information. --n, --dry-run Report what would change but don't change anything. +-n, --dry-run Report what would change, but don't change anything. Run "pub help" to see global options.