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 {
67
67
if (configSetting == null ) {
68
68
continue ;
69
69
}
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
+ );
71
76
}
72
77
argParser.addFlag (
73
78
'clear-features' ,
Original file line number Diff line number Diff line change @@ -59,6 +59,13 @@ void main() {
59
59
);
60
60
});
61
61
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
+
62
69
testUsingContext ('throws error on excess arguments' , () {
63
70
final configCommand = ConfigCommand ();
64
71
final CommandRunner <void > commandRunner = createTestCommandRunner (configCommand);
You can’t perform that action at this time.
0 commit comments