Clean up copy and formatting of unpack command help (#4261)
diff --git a/lib/src/command/unpack.dart b/lib/src/command/unpack.dart
index 0190d22..6c96f67 100644
--- a/lib/src/command/unpack.dart
+++ b/lib/src/command/unpack.dart
@@ -31,27 +31,27 @@
$topLevelProgram pub unpack foo
-Downloads and extracts the latest stable package:foo from pub.dev in a
-directory `foo-<version>`.
+Downloads and extracts the latest stable version of package:foo from pub.dev
+in a directory `foo-<version>`.
$topLevelProgram pub unpack foo:1.2.3-pre --no-resolve
Downloads and extracts package:foo version 1.2.3-pre in a directory
-`foo-1.2.3-pre` without running running implicit `pub get`.
+`foo-1.2.3-pre` without running implicit `pub get`.
$topLevelProgram pub unpack foo --output=archives
-Downloads and extracts latest stable version of package:foo in a directory
+Downloads and extracts the latest stable version of package:foo in a directory
`archives/foo-<version>`.
$topLevelProgram pub unpack 'foo:{hosted:"https://my_repo.org"}'
-Downloads and extracts latest stable version of package:foo from my_repo.org
+Downloads and extracts the latest stable version of package:foo from my_repo.org
in a directory `foo-<version>`.
''';
@override
- String get argumentsDescription => 'package-name[:constraint]';
+ String get argumentsDescription => 'package-name[:descriptor]';
@override
String get docUrl => 'https://dart.dev/tools/pub/cmd/pub-unpack';
@@ -62,19 +62,19 @@
UnpackCommand() {
argParser.addFlag(
'resolve',
- help: 'Whether to do pub get in the downloaded folder',
+ help: 'Whether to run pub get in the downloaded folder.',
defaultsTo: true,
hide: log.verbosity != log.Verbosity.all,
);
argParser.addFlag(
'force',
abbr: 'f',
- help: 'overwrites an existing folder if it exists',
+ help: 'Overwrite the target directory if it already exists.',
);
argParser.addOption(
'output',
abbr: 'o',
- help: 'Download and extract the package in this dir',
+ help: 'Download and extract the package in the specified directory.',
defaultsTo: '.',
);
}
@@ -87,15 +87,15 @@
@override
Future<void> runProtected() async {
if (argResults.rest.isEmpty) {
- usageException('Provide a package name');
+ usageException('Provide a package name.');
}
if (argResults.rest.length > 1) {
- usageException('Please provide only a single package name');
+ usageException('Provide only a single package name.');
}
final arg = argResults.rest[0];
final match = _argRegExp.firstMatch(arg);
if (match == null) {
- usageException('Use the form package:constraint to specify the package.');
+ usageException('Use the form package:descriptor to specify the package.');
}
final parseResult = _parseDescriptor(
match.namedGroup('name')!,
@@ -124,7 +124,7 @@
deleteEntry(destinationDir);
} else {
fail(
- 'Target directory `$destinationDir` already exists. Use --force to overwrite',
+ 'Target directory `$destinationDir` already exists. Use --force to overwrite.',
);
}
}
diff --git a/test/testdata/goldens/help_test/pub unpack --help.txt b/test/testdata/goldens/help_test/pub unpack --help.txt
index ba1a59d..f96e8fa 100644
--- a/test/testdata/goldens/help_test/pub unpack --help.txt
+++ b/test/testdata/goldens/help_test/pub unpack --help.txt
@@ -8,29 +8,29 @@
dart pub unpack foo
-Downloads and extracts the latest stable package:foo from pub.dev in a
-directory `foo-<version>`.
+Downloads and extracts the latest stable version of package:foo from pub.dev
+in a directory `foo-<version>`.
dart pub unpack foo:1.2.3-pre --no-resolve
Downloads and extracts package:foo version 1.2.3-pre in a directory
-`foo-1.2.3-pre` without running running implicit `pub get`.
+`foo-1.2.3-pre` without running implicit `pub get`.
dart pub unpack foo --output=archives
-Downloads and extracts latest stable version of package:foo in a directory
+Downloads and extracts the latest stable version of package:foo in a directory
`archives/foo-<version>`.
dart pub unpack 'foo:{hosted:"https://my_repo.org"}'
-Downloads and extracts latest stable version of package:foo from my_repo.org
+Downloads and extracts the latest stable version of package:foo from my_repo.org
in a directory `foo-<version>`.
-Usage: pub unpack package-name[:constraint]
+Usage: pub unpack package-name[:descriptor]
-h, --help Print this usage information.
--f, --[no-]force overwrites an existing folder if it exists
--o, --output Download and extract the package in this dir
+-f, --[no-]force Overwrite the target directory if it already exists.
+-o, --output Download and extract the package in the specified directory.
(defaults to ".")
Run "pub help" to see global options.
diff --git a/test/unpack_test.dart b/test/unpack_test.dart
index ebf83ce..21752f9 100644
--- a/test/unpack_test.dart
+++ b/test/unpack_test.dart
@@ -39,7 +39,7 @@
await runPub(
args: ['unpack', 'foo'],
error:
- 'Target directory `.${s}foo-1.2.3` already exists. Use --force to overwrite',
+ 'Target directory `.${s}foo-1.2.3` already exists. Use --force to overwrite.',
exitCode: 1,
);
await runPub(args: ['unpack', 'foo', '--force']);