@@ -17,6 +17,7 @@ const overwriteOption = 'overwrite';
1717const requiredOption = 'required' ;
1818const _binaryName = 'dartfix' ;
1919const _colorOption = 'color' ;
20+ const _serverSnapshot = 'server' ;
2021
2122// options only supported by server 1.22.2 and greater
2223const _helpOption = 'help' ;
@@ -29,6 +30,7 @@ class Options {
2930
3031 List <String > targets;
3132 final String sdkPath;
33+ final String serverSnapshot;
3234
3335 final bool requiredFixes;
3436 final List <String > includeFixes;
@@ -49,6 +51,7 @@ class Options {
4951 overwrite = results[overwriteOption] as bool ,
5052 requiredFixes = results[requiredOption] as bool ,
5153 sdkPath = _getSdkPath (),
54+ serverSnapshot = results[_serverSnapshot],
5255 showHelp = results[_helpOption] as bool || results.arguments.isEmpty,
5356 targets = results.rest,
5457 useColor = results.wasParsed (_colorOption)
@@ -92,6 +95,8 @@ class Options {
9295 help: 'Display this help message.' ,
9396 defaultsTo: false ,
9497 negatable: false )
98+ ..addOption (_serverSnapshot,
99+ help: 'Path to the analysis server snapshot file.' , valueHelp: 'path' )
95100 ..addFlag (_verboseOption,
96101 abbr: 'v' ,
97102 defaultsTo: false ,
@@ -109,7 +114,6 @@ class Options {
109114 } on FormatException catch (e) {
110115 logger ?? = new Logger .standard (ansi: new Ansi (Ansi .terminalSupportsAnsi));
111116 logger.stderr (e.message);
112- logger.stderr ('\n ' );
113117 _showUsage (parser, logger);
114118 context.exit (15 );
115119 }
@@ -194,6 +198,7 @@ Usage: $_binaryName [options...] <directory paths>
194198 out (parser.usage);
195199 out (showHelpHint
196200 ? '''
201+
197202Use --$_helpOption to display the fixes that can be specified using either
198203--$includeOption or --$excludeOption .'''
199204 : '' );
0 commit comments