Fix the length of the valueHelp on the --sample option for the create command, and turn on wrapping. (#28264)
The wrapping for some commands was never actually turned on, so this turns it on. Also, it shortens the `valueHelp` for the `--sample` option to be just "id" instead of "the sample ID of the desired sample from the API documentation website (http://docs.flutter.io)", which was causing the line to get far too long. Fixes #23074
This commit is contained in:
@@ -90,9 +90,10 @@ class CreateCommand extends FlutterCommand {
|
||||
'sample',
|
||||
abbr: 's',
|
||||
help: 'Specifies the Flutter code sample to use as the main.dart for an application. Implies '
|
||||
'--template=app.',
|
||||
'--template=app. The value should be the sample ID of the desired sample from the API '
|
||||
'documentation website (http://docs.flutter.io).',
|
||||
defaultsTo: null,
|
||||
valueHelp: 'the sample ID of the desired sample from the API documentation website (http://docs.flutter.io)'
|
||||
valueHelp: 'id',
|
||||
);
|
||||
argParser.addFlag(
|
||||
'overwrite',
|
||||
|
||||
@@ -13,6 +13,7 @@ import '../application_package.dart';
|
||||
import '../base/common.dart';
|
||||
import '../base/context.dart';
|
||||
import '../base/file_system.dart';
|
||||
import '../base/terminal.dart';
|
||||
import '../base/time.dart';
|
||||
import '../base/user_messages.dart';
|
||||
import '../base/utils.dart';
|
||||
@@ -82,7 +83,10 @@ abstract class FlutterCommand extends Command<void> {
|
||||
|
||||
@override
|
||||
ArgParser get argParser => _argParser;
|
||||
final ArgParser _argParser = ArgParser(allowTrailingOptions: false);
|
||||
final ArgParser _argParser = ArgParser(
|
||||
allowTrailingOptions: false,
|
||||
usageLineLength: outputPreferences.wrapText ? outputPreferences.wrapColumn : null,
|
||||
);
|
||||
|
||||
@override
|
||||
FlutterCommandRunner get runner => super.runner;
|
||||
|
||||
Reference in New Issue
Block a user