@@ -15,6 +15,7 @@ public enum Operation
1515 {
1616 Format ,
1717 ListRules ,
18+ ShowHelp
1819 }
1920
2021 public sealed class CommandLineOptions
@@ -30,6 +31,18 @@ public sealed class CommandLineOptions
3031 allowTables : false ,
3132 verbose : false ) ;
3233
34+ public static readonly CommandLineOptions ShowHelp = new CommandLineOptions (
35+ Operation . ShowHelp ,
36+ ImmutableArray < string [ ] > . Empty ,
37+ ImmutableArray < string > . Empty ,
38+ ImmutableDictionary < string , bool > . Empty ,
39+ ImmutableArray < string > . Empty ,
40+ ImmutableArray < string > . Empty ,
41+ null ,
42+ allowTables : false ,
43+ verbose : false ) ;
44+
45+
3346 public readonly Operation Operation ;
3447 public readonly ImmutableArray < string [ ] > PreprocessorConfigurations ;
3548 public readonly ImmutableArray < string > CopyrightHeader ;
@@ -143,8 +156,7 @@ containing a custom copyright header.
143156 /rule(+|-) - Enable (default) or disable the specified rule
144157 /rules - List the available rules
145158 /verbose - Verbose output
146-
147- Use ConvertTests to convert MSTest tests to xUnit.
159+ /help - Displays this usage message (short form: /?)
148160" ;
149161
150162 public static void PrintUsage ( )
@@ -245,6 +257,10 @@ public static CommandLineParseResult Parse(string[] args)
245257 {
246258 return CommandLineParseResult . CreateSuccess ( CommandLineOptions . ListRules ) ;
247259 }
260+ else if ( comparer . Equals ( arg , "/?" ) || comparer . Equals ( arg , "/help" ) )
261+ {
262+ return CommandLineParseResult . CreateSuccess ( CommandLineOptions . ShowHelp ) ;
263+ }
248264 else if ( arg . StartsWith ( "/" , comparison ) )
249265 {
250266 return CommandLineParseResult . CreateError ( $ "Unrecognized option \" { arg } \" ") ;
0 commit comments