@@ -9,12 +9,12 @@ import 'package:cli_util/cli_logging.dart';
99import 'package:dartfix/src/context.dart' ;
1010import 'package:path/path.dart' as path;
1111
12- const excludeOption = 'exclude' ;
13-
1412const forceOption = 'force' ;
15- const includeOption = 'include' ;
13+ const includeOption = 'fix' ;
14+ const excludeOption = 'exclude' ;
1615const overwriteOption = 'overwrite' ;
1716const requiredOption = 'required' ;
17+
1818const _binaryName = 'dartfix' ;
1919const _colorOption = 'color' ;
2020const _serverSnapshot = 'server' ;
@@ -44,10 +44,8 @@ class Options {
4444
4545 Options ._fromArgs (this .context, ArgResults results)
4646 : force = results[forceOption] as bool ,
47- includeFixes =
48- (results[includeOption] as List ?? []).cast <String >().toList (),
49- excludeFixes =
50- (results[excludeOption] as List ?? []).cast <String >().toList (),
47+ includeFixes = (results[includeOption] as List ?? []).cast <String >(),
48+ excludeFixes = (results[excludeOption] as List ?? []).cast <String >(),
5149 overwrite = results[overwriteOption] as bool ,
5250 requiredFixes = results[requiredOption] as bool ,
5351 sdkPath = _getSdkPath (),
@@ -57,7 +55,9 @@ class Options {
5755 useColor = results.wasParsed (_colorOption)
5856 ? results[_colorOption] as bool
5957 : null ,
60- verbose = results[_verboseOption] as bool ;
58+ verbose = results[_verboseOption] as bool {
59+ includeFixes.addAll ((results['include' ] as List ?? []).cast <String >());
60+ }
6161
6262 String makeAbsoluteAndNormalize (String target) {
6363 if (! path.isAbsolute (target)) {
@@ -70,7 +70,10 @@ class Options {
7070 final parser = ArgParser (allowTrailingOptions: true )
7171 ..addSeparator ('Choosing fixes to be applied:' )
7272 ..addMultiOption (includeOption,
73- abbr: 'i' , help: 'Include a specific fix.' , valueHelp: 'name-of-fix' )
73+ help: 'Include a specific fix.' , valueHelp: 'name-of-fix' )
74+ // 'include' is an alias for 'fix' (above)
75+ ..addMultiOption ('include' ,
76+ help: 'Include a specific fix.' , valueHelp: 'name-of-fix' , hide: true )
7477 ..addMultiOption (excludeOption,
7578 abbr: 'x' , help: 'Exclude a specific fix.' , valueHelp: 'name-of-fix' )
7679 ..addFlag (requiredOption,
0 commit comments