Skip to content

Commit b316940

Browse files
authored
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
1 parent 04b7a5b commit b316940

2 files changed

Lines changed: 8 additions & 3 deletions

File tree

‎packages/flutter_tools/lib/src/commands/create.dart‎

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -90,9 +90,10 @@ class CreateCommand extends FlutterCommand {
9090
'sample',
9191
abbr: 's',
9292
help: 'Specifies the Flutter code sample to use as the main.dart for an application. Implies '
93-
'--template=app.',
93+
'--template=app. The value should be the sample ID of the desired sample from the API '
94+
'documentation website (http://docs.flutter.io).',
9495
defaultsTo: null,
95-
valueHelp: 'the sample ID of the desired sample from the API documentation website (http://docs.flutter.io)'
96+
valueHelp: 'id',
9697
);
9798
argParser.addFlag(
9899
'overwrite',

‎packages/flutter_tools/lib/src/runner/flutter_command.dart‎

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,7 @@ import '../application_package.dart';
1313
import '../base/common.dart';
1414
import '../base/context.dart';
1515
import '../base/file_system.dart';
16+
import '../base/terminal.dart';
1617
import '../base/time.dart';
1718
import '../base/user_messages.dart';
1819
import '../base/utils.dart';
@@ -82,7 +83,10 @@ abstract class FlutterCommand extends Command<void> {
8283

8384
@override
8485
ArgParser get argParser => _argParser;
85-
final ArgParser _argParser = ArgParser(allowTrailingOptions: false);
86+
final ArgParser _argParser = ArgParser(
87+
allowTrailingOptions: false,
88+
usageLineLength: outputPreferences.wrapText ? outputPreferences.wrapColumn : null,
89+
);
8690

8791
@override
8892
FlutterCommandRunner get runner => super.runner;

0 commit comments

Comments
 (0)