@@ -266,7 +266,7 @@ public bool AdditionalNewLineAfterOption
266
266
/// </summary>
267
267
public bool AddNewLineBetweenHelpSections
268
268
{
269
- get { return addNewLineBetweenHelpSections ; }
269
+ get { return addNewLineBetweenHelpSections ; }
270
270
set { addNewLineBetweenHelpSections = value ; }
271
271
}
272
272
@@ -416,7 +416,7 @@ public static HelpText AutoBuild<T>(ParserResult<T> parserResult, int maxDisplay
416
416
/// </returns>
417
417
/// <remarks>This feature is meant to be invoked automatically by the parser, setting the HelpWriter property
418
418
/// of <see cref="CommandLine.ParserSettings"/>.</remarks>
419
- public static HelpText AutoBuild < T > ( ParserResult < T > parserResult , Func < HelpText , HelpText > onError , int maxDisplayWidth = DefaultMaximumLength )
419
+ public static HelpText AutoBuild < T > ( ParserResult < T > parserResult , Func < HelpText , HelpText > onError , int maxDisplayWidth = DefaultMaximumLength )
420
420
{
421
421
if ( parserResult . Tag != ParserResultType . NotParsed )
422
422
throw new ArgumentException ( "Excepting NotParsed<T> type." , "parserResult" ) ;
@@ -434,9 +434,9 @@ public static HelpText AutoBuild<T>(ParserResult<T> parserResult, Func<HelpText,
434
434
} , e => e , maxDisplayWidth : maxDisplayWidth ) ;
435
435
436
436
var err = errors . OfType < HelpVerbRequestedError > ( ) . Single ( ) ;
437
- var pr = new NotParsed < object > ( TypeInfo . Create ( err . Type ) , Enumerable . Empty < Error > ( ) ) ;
437
+ var pr = new NotParsed < object > ( TypeInfo . Create ( err . Type ) , new Error [ ] { err } ) ;
438
438
return err . Matched
439
- ? AutoBuild ( pr , current =>
439
+ ? AutoBuild ( pr , current =>
440
440
{
441
441
onError ? . Invoke ( current ) ;
442
442
return DefaultParsingErrorsHandler ( pr , current ) ;
@@ -460,7 +460,6 @@ public static HelpText DefaultParsingErrorsHandler<T>(ParserResult<T> parserResu
460
460
461
461
if ( ( ( NotParsed < T > ) parserResult ) . Errors . OnlyMeaningfulOnes ( ) . Empty ( ) )
462
462
return current ;
463
-
464
463
var errors = RenderParsingErrorsTextAsLines ( parserResult ,
465
464
current . SentenceBuilder . FormatError ,
466
465
current . SentenceBuilder . FormatMutuallyExclusiveSetErrors ,
@@ -761,8 +760,8 @@ public override string ToString()
761
760
var result = new StringBuilder ( sbLength ) ;
762
761
763
762
result . Append ( heading )
764
- . AppendWhen ( ! string . IsNullOrEmpty ( copyright ) ,
765
- Environment . NewLine ,
763
+ . AppendWhen ( ! string . IsNullOrEmpty ( copyright ) ,
764
+ Environment . NewLine ,
766
765
copyright )
767
766
. AppendWhen ( preOptionsHelp . SafeLength ( ) > 0 ,
768
767
NewLineIfNeededBefore ( preOptionsHelp ) ,
@@ -772,15 +771,15 @@ public override string ToString()
772
771
Environment . NewLine ,
773
772
Environment . NewLine ,
774
773
optionsHelp . SafeToString ( ) )
775
- . AppendWhen ( postOptionsHelp . SafeLength ( ) > 0 ,
774
+ . AppendWhen ( postOptionsHelp . SafeLength ( ) > 0 ,
776
775
NewLineIfNeededBefore ( postOptionsHelp ) ,
777
776
Environment . NewLine ,
778
777
postOptionsHelp . ToString ( ) ) ;
779
778
780
779
string NewLineIfNeededBefore ( StringBuilder sb )
781
780
{
782
- if ( AddNewLineBetweenHelpSections
783
- && result . Length > 0
781
+ if ( AddNewLineBetweenHelpSections
782
+ && result . Length > 0
784
783
&& ! result . SafeEndsWith ( Environment . NewLine )
785
784
&& ! sb . SafeStartsWith ( Environment . NewLine ) )
786
785
return Environment . NewLine ;
@@ -981,7 +980,7 @@ specification is OptionSpecification optionSpecification &&
981
980
982
981
if ( optionGroupSpecification != null )
983
982
{
984
- optionHelpText = "({0}: {1}) " . FormatInvariant ( optionGroupWord , optionGroupSpecification . Group ) + optionHelpText ;
983
+ optionHelpText = "({0}: {1}) " . FormatInvariant ( optionGroupWord , optionGroupSpecification . Group ) + optionHelpText ;
985
984
}
986
985
987
986
//note that we need to indent trim the start of the string because it's going to be
0 commit comments