File tree Expand file tree Collapse file tree 2 files changed +13
-1
lines changed
test/commands.shard/hermetic Expand file tree Collapse file tree 2 files changed +13
-1
lines changed Original file line number Diff line number Diff line change @@ -67,7 +67,12 @@ class ConfigCommand extends FlutterCommand {
6767 if (configSetting == null ) {
6868 continue ;
6969 }
70- argParser.addFlag (configSetting, help: feature.generateHelpMessage ());
70+ final String channel = globals.flutterVersion.channel;
71+ argParser.addFlag (
72+ configSetting,
73+ help: feature.generateHelpMessage (),
74+ defaultsTo: feature.getSettingForChannel (channel).enabledByDefault,
75+ );
7176 }
7277 argParser.addFlag (
7378 'clear-features' ,
Original file line number Diff line number Diff line change @@ -59,6 +59,13 @@ void main() {
5959 );
6060 });
6161
62+ testUsingContext ('prints default values with --help' , () async {
63+ final configCommand = ConfigCommand ();
64+ final CommandRunner <void > commandRunner = createTestCommandRunner (configCommand);
65+ await commandRunner.run (< String > ['config' , '--help' ]);
66+ expect (testLogger.statusText, contains ('(defaults to on)' ));
67+ });
68+
6269 testUsingContext ('throws error on excess arguments' , () {
6370 final configCommand = ConfigCommand ();
6471 final CommandRunner <void > commandRunner = createTestCommandRunner (configCommand);
You can’t perform that action at this time.
0 commit comments