[dartdev] update the help text for dartdev and related commands

Change-Id: Ia7139b109872575e58fa8f1cbc4aa72bef44bee5
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/161020
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Commit-Queue: Devon Carew <devoncarew@google.com>
This commit is contained in:
Devon Carew 2020-08-31 20:17:48 +00:00 committed by commit-bot@chromium.org
parent b59cf7f006
commit f81dadfa32
11 changed files with 32 additions and 22 deletions

View file

@ -6,11 +6,12 @@ A command-line utility for Dart development.
Usage: dart [<vm-flags>] <command|dart-file> [<arguments>]
Global options:
-h, --help Print this usage information.
-v, --verbose Show additional command output.
--version Print the Dart SDK version.
--enable-analytics Enable anonymous analytics.
--disable-analytics Disable anonymous analytics.
-h, --help Print this usage information.
-v, --verbose Show additional command output.
--version Print the Dart SDK version.
--enable-analytics Enable anonymous analytics.
--disable-analytics Disable anonymous analytics.
--enable-experiment=<experiment> Enable one or more experimental features (see dart.dev/go/experiments).
Available commands:
analyze Analyze the project's Dart code.
@ -19,7 +20,7 @@ Available commands:
format Idiomatically formats Dart source code.
pub Work with packages.
run Run a Dart program.
test Runs tests in this project.
test Run tests in this package.
Run "dart help <command>" for more information about a command.
```

View file

@ -230,6 +230,10 @@ class DartdevRunner<int> extends CommandRunner {
addCommand(TestCommand());
}
@override
String get usageFooter =>
'See https://dart.dev/tools/dart-tool for detailed documentation.';
@override
String get invocation =>
'dart [<vm-flags>] <command|dart-file> [<arguments>]';

View file

@ -28,7 +28,7 @@ final Map<String, Option> commonOptions = {
abbr: 'o',
help: '''
Write the output to <file name>.
This can be an absolute or reletive path.
This can be an absolute or relative path.
''',
),
};
@ -175,7 +175,7 @@ class CompileNativeCommand extends DartdevCommand<int> {
)
..addMultiOption('define', abbr: 'D', valueHelp: 'key=value', help: '''
Define an environment declaration. To specify multiple declarations, use multiple options or use commas to separate key-value pairs.
For example, 'dart compile $commandName -Da=1,b=2 main.dart'.''')
For example: dart compile $commandName -Da=1,b=2 main.dart.''')
..addFlag('enable-asserts',
negatable: false, help: 'Enable assert statements.')
..addOption('packages',
@ -184,7 +184,7 @@ For example, 'dart compile $commandName -Da=1,b=2 main.dart'.''')
help:
'''Get package locations from the specified file instead of .packages.
<path> can be relative or absolute.
For example, 'dart compile $commandName --packages=/tmp/pkgs main.dart'.''')
For example: dart compile $commandName --packages=/tmp/pkgs main.dart.''')
..addOption('save-debugging-info', abbr: 'S', valueHelp: 'path', help: '''
Remove debugging information from the output and save it separately to the specified file.
<path> can be relative or absolute.''');

View file

@ -82,7 +82,7 @@ class RunCommand extends DartdevCommand<int> {
' when running with --enable-vm-service.',
)
..addSeparator(
'Other debugging options include:',
'Other debugging options:',
)
..addFlag(
'pause-isolates-on-start',

View file

@ -18,7 +18,7 @@ import '../sdk.dart';
import '../vm_interop_handler.dart';
class TestCommand extends DartdevCommand<int> {
TestCommand() : super('test', 'Runs tests in this project.') {
TestCommand() : super('test', 'Run tests in this package.') {
generateParser(argParser);
}

View file

@ -8,7 +8,8 @@ environment:
dependencies:
analysis_server_client:
path: ../analysis_server_client
analyzer: any
analyzer:
path: ../analyzer
args: ^1.6.0
cli_util: '>=0.1.4 <0.3.0'
dart2native:

View file

@ -20,7 +20,7 @@ void defineTest() {
var result = p.runSync('test', ['--help']);
expect(result.exitCode, 0);
expect(result.stderr, isEmpty);
expect(result.stdout, contains('Runs tests in this project.'));
expect(result.stdout, contains('Run tests in this package.'));
expect(result.stdout, contains('Usage: dart test [arguments]'));
expect(result.stdout, contains('======== Selecting Tests'));
});

View file

@ -6,6 +6,8 @@ import 'package:analysis_server_client/protocol.dart';
import '../util.dart';
// TODO(devoncarew): This is only referenced from tests.
/// Perform the indicated source edits to the given source, returning the
/// resulting transformed text.
String applyEdits(SourceFileEdit sourceFileEdit, String source) {

View file

@ -6,6 +6,8 @@ import 'package:analysis_server_client/protocol.dart';
import 'package:cli_util/cli_logging.dart';
import 'package:path/path.dart' as path;
// TODO(devoncarew): This is only referenced from tests.
/// Given a Logger and an analysis issue, render the issue to the logger.
class IssueRenderer {
final Logger logger;

View file

@ -8,6 +8,8 @@ import 'package:args/args.dart';
import 'package:args/src/arg_parser.dart';
import 'package:path/path.dart' as path;
// TODO(devoncarew): This class is unused.
class MigrateOptions {
static const applyChangesOption = 'apply-changes';
static const debugOption = 'debug';
@ -62,8 +64,8 @@ class MigrateOptions {
ignoreErrorsOption,
defaultsTo: false,
negatable: false,
help: 'Attempt to perform null safety analysis even if there are '
'analysis errors in the project.',
help: 'Attempt to perform null safety analysis even if the package has '
'analysis errors.',
);
argParser.addOption(
sdkPathOption,

View file

@ -393,14 +393,12 @@ class MigrationCli {
negatable: true,
help: 'Show an interactive preview of the proposed null safety changes '
'in a browser window.\n'
'With --no-web-preview, the proposed changes are instead printed to '
'the console.');
'--no-web-preview prints proposed changes to the console.');
parser.addOption(CommandLineOptions.sdkPathOption,
help: 'The path to the Dart SDK.', hide: hide);
parser.addOption(CommandLineOptions.summaryOption,
help:
'Output path for a machine-readable summary of migration changes');
help: 'Output a machine-readable summary of migration changes.');
}
static void addCoreOptions(ArgParser parser, bool hide) {
@ -412,8 +410,8 @@ class MigrationCli {
CommandLineOptions.ignoreErrorsFlag,
defaultsTo: false,
negatable: false,
help: 'Attempt to perform null safety analysis even if there are '
'analysis errors in the project.',
help: 'Attempt to perform null safety analysis even if the package has '
'analysis errors.',
);
parser.addFlag(CommandLineOptions.ignoreExceptionsFlag,
defaultsTo: false,
@ -424,7 +422,7 @@ class MigrationCli {
parser.addFlag(CommandLineOptions.verboseFlag,
abbr: 'v',
defaultsTo: false,
help: 'Verbose output.',
help: 'Show additional command output.',
negatable: false);
parser.addOption(CommandLineOptions.previewHostnameOption,
defaultsTo: 'localhost',