Merge pull request #950 from dart-lang/reword-help
Reword the help text to be consistent with other "dart" commands.
diff --git a/bin/format.dart b/bin/format.dart
index bb4780c..c3cfee8 100644
--- a/bin/format.dart
+++ b/bin/format.dart
@@ -153,7 +153,7 @@
void printUsage(ArgParser parser, [String error]) {
var output = stdout;
- var message = 'Idiomatically formats Dart source code.';
+ var message = 'Idiomatically format Dart source code.';
if (error != null) {
message = error;
output = stdout;
diff --git a/lib/src/cli/format_command.dart b/lib/src/cli/format_command.dart
index b312381..5cbe0d5 100644
--- a/lib/src/cli/format_command.dart
+++ b/lib/src/cli/format_command.dart
@@ -18,7 +18,7 @@
String get name => 'format';
@override
- String get description => 'Idiomatically formats Dart source code.';
+ String get description => 'Idiomatically format Dart source code.';
@override
String get invocation =>
diff --git a/lib/src/cli/options.dart b/lib/src/cli/options.dart
index d36f0c5..e6f5aba 100644
--- a/lib/src/cli/options.dart
+++ b/lib/src/cli/options.dart
@@ -37,17 +37,17 @@
} else {
parser.addOption('output',
abbr: 'o',
- help: 'Where formatted output should be written.',
+ help: 'Set where to write formatted output.',
allowed: ['write', 'show', 'json', 'none'],
allowedHelp: {
- 'write': 'Overwrite formatted files on disc.',
+ 'write': 'Overwrite formatted files on disk.',
'show': 'Print code to terminal.',
- 'json': 'Print code and selection as JSON',
- 'none': 'Discard.'
+ 'json': 'Print code and selection as JSON.',
+ 'none': 'Discard output.'
},
defaultsTo: 'write');
parser.addOption('show',
- help: 'Which filenames to print.',
+ help: 'Set which filenames to print.',
allowed: ['all', 'changed', 'none'],
allowedHelp: {
'all': 'All visited files and directories.',
@@ -57,11 +57,11 @@
defaultsTo: 'changed',
hide: !verbose);
parser.addOption('summary',
- help: 'Summary shown after formatting completes.',
+ help: 'Show the specified summary after formatting.',
allowed: ['line', 'profile', 'none'],
allowedHelp: {
- 'line': 'Single line summary.',
- 'profile': 'Tracks how long it took for format each file.',
+ 'line': 'Single-line summary.',
+ 'profile': 'How long it took for format each file.',
'none': 'No summary.'
},
defaultsTo: 'line',
@@ -83,7 +83,7 @@
abbr: 'l', help: 'Wrap lines longer than this.', defaultsTo: '80');
parser.addOption('indent',
abbr: 'i',
- help: 'Spaces of leading indentation.',
+ help: 'Add this many spaces of leading indentation.',
defaultsTo: '0',
hide: !verbose);
if (oldCli) {
@@ -108,10 +108,10 @@
if (verbose) parser.addSeparator('Options when formatting from stdin:');
parser.addOption(oldCli ? 'preserve' : 'selection',
- help: 'Selection to preserve formatted as "start:length".',
+ help: 'Track selection (given as "start:length") through formatting.',
hide: !verbose);
parser.addOption('stdin-name',
- help: 'The path name to show when an error occurs.',
+ help: 'Use this path in error messages when input is read from stdin.',
defaultsTo: 'stdin',
hide: !verbose);
diff --git a/test/command_line_test.dart b/test/command_line_test.dart
index d328374..c02a2d2 100644
--- a/test/command_line_test.dart
+++ b/test/command_line_test.dart
@@ -116,7 +116,7 @@
test('non-verbose shows description and common options', () async {
var process = await runFormatter(['--help']);
await expectLater(
- process.stdout, emits('Idiomatically formats Dart source code.'));
+ process.stdout, emits('Idiomatically format Dart source code.'));
await expectLater(process.stdout, emits(''));
await expectLater(process.stdout,
emits('Usage: dartfmt [options...] [files or directories...]'));
@@ -130,7 +130,7 @@
test('verbose shows description and all options', () async {
var process = await runFormatter(['--help', '--verbose']);
await expectLater(
- process.stdout, emits('Idiomatically formats Dart source code.'));
+ process.stdout, emits('Idiomatically format Dart source code.'));
await expectLater(process.stdout, emits(''));
await expectLater(process.stdout,
emits('Usage: dartfmt [options...] [files or directories...]'));
diff --git a/test/command_test.dart b/test/command_test.dart
index c59eab1..a6dece9 100644
--- a/test/command_test.dart
+++ b/test/command_test.dart
@@ -284,7 +284,7 @@
test('non-verbose shows description and common options', () async {
var process = await runCommand(['--help']);
expect(
- await process.stdout.next, 'Idiomatically formats Dart source code.');
+ await process.stdout.next, 'Idiomatically format Dart source code.');
await expectLater(process.stdout, emitsThrough(contains('-o, --output')));
await expectLater(process.stdout, emitsThrough(contains('--fix')));
await expectLater(process.stdout, neverEmits(contains('--summary')));
@@ -294,7 +294,7 @@
test('verbose shows description and all options', () async {
var process = await runCommand(['--help', '--verbose']);
expect(
- await process.stdout.next, 'Idiomatically formats Dart source code.');
+ await process.stdout.next, 'Idiomatically format Dart source code.');
await expectLater(process.stdout, emitsThrough(contains('-o, --output')));
await expectLater(process.stdout, emitsThrough(contains('--show')));
await expectLater(process.stdout, emitsThrough(contains('--summary')));
diff --git a/tool/command_shell.dart b/tool/command_shell.dart
index dc12146..419fcb0 100644
--- a/tool/command_shell.dart
+++ b/tool/command_shell.dart
@@ -13,7 +13,7 @@
/// it prints.
void main(List<String> arguments) async {
var runner =
- CommandRunner('dartfmt', 'Idiomatically formats Dart source code.');
+ CommandRunner('dartfmt', 'Idiomatically format Dart source code.');
runner.argParser.addFlag('verbose',
abbr: 'v', negatable: false, help: 'Show verbose help.');
runner.addCommand(FormatCommand(