From 2e76fecacb2dd3c6028a3dc87df45ffa6d85629b Mon Sep 17 00:00:00 2001 From: Devon Carew Date: Mon, 31 Aug 2020 22:31:40 +0000 Subject: [PATCH] [dartdev] a few more updates to the dartdev tool help Change-Id: I40beba78d27cf20d282b8551eda2654653637b12 Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/161182 Reviewed-by: Kathy Walrath Reviewed-by: Brian Wilkerson Commit-Queue: Devon Carew --- pkg/dartdev/README.md | 14 +++++++------- pkg/dartdev/lib/dartdev.dart | 11 +++++++---- pkg/dartdev/lib/src/commands/compile.dart | 4 ++-- 3 files changed, 16 insertions(+), 13 deletions(-) diff --git a/pkg/dartdev/README.md b/pkg/dartdev/README.md index 7b9d987f38f..ef1c6c9400b 100644 --- a/pkg/dartdev/README.md +++ b/pkg/dartdev/README.md @@ -6,23 +6,23 @@ A command-line utility for Dart development. Usage: dart [] [] 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. - --enable-experiment= Enable one or more experimental features (see dart.dev/go/experiments). +-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. Available commands: analyze Analyze the project's Dart code. compile Compile Dart to various formats. create Create a new project. - format Idiomatically formats Dart source code. + format Idiomatically format Dart source code. pub Work with packages. run Run a Dart program. test Run tests in this package. Run "dart help " for more information about a command. +See https://dart.dev/tools/dart-tool for detailed documentation. ``` ## Contributing diff --git a/pkg/dartdev/lib/dartdev.dart b/pkg/dartdev/lib/dartdev.dart index b63580ab654..9b186d063c3 100644 --- a/pkg/dartdev/lib/dartdev.dart +++ b/pkg/dartdev/lib/dartdev.dart @@ -206,10 +206,12 @@ class DartdevRunner extends CommandRunner { // A hidden flag to disable analytics on this run, this constructor can be // called with this flag, but should be removed before run() is called as // the flag has not been added to all sub-commands. - argParser.addFlag('disable-dartdev-analytics', - negatable: false, - help: 'Disable anonymous analytics for this `dart *` run', - hide: true); + argParser.addFlag( + 'disable-dartdev-analytics', + negatable: false, + help: 'Disable anonymous analytics for this `dart *` run', + hide: true, + ); // Another hidden flag used by the VM to indicate that DDS should be // launched. Should be removed for all commands other than `run`. @@ -254,6 +256,7 @@ class DartdevRunner extends CommandRunner { allowedHelp: verbose ? allowedHelp : null, help: 'Enable one or more experimental features ' '(see dart.dev/go/experiments).', + hide: !verbose, ); } diff --git a/pkg/dartdev/lib/src/commands/compile.dart b/pkg/dartdev/lib/src/commands/compile.dart index 669d4be8ef8..5da71687caa 100644 --- a/pkg/dartdev/lib/src/commands/compile.dart +++ b/pkg/dartdev/lib/src/commands/compile.dart @@ -175,7 +175,7 @@ class CompileNativeCommand extends DartdevCommand { ) ..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. 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. can be relative or absolute.''');