@@ -206,7 +206,7 @@ public SentenceBuilder SentenceBuilder
206206 public static HelpText AutoBuild < T > (
207207 ParserResult < T > parserResult ,
208208 Func < HelpText , HelpText > onError ,
209- Func < Example , Example > onExample ,
209+ Func < Example , Example > onExample ,
210210 bool verbsIndex = false ,
211211 int maxDisplayWidth = DefaultMaximumLength )
212212 {
@@ -254,7 +254,7 @@ public static HelpText AutoBuild<T>(
254254
255255 usageAttr . Do (
256256 usage => usage . AddToHelpText ( auto , true ) ) ;
257-
257+
258258 usageLines . Do (
259259 lines => auto . AddPreOptionsLines ( lines ) ) ;
260260
@@ -519,7 +519,7 @@ public static IEnumerable<string> RenderParsingErrorsTextAsLines<T>(
519519 yield return line . ToString ( ) ;
520520 }
521521
522- var mutuallyErrs =
522+ var mutuallyErrs =
523523 formatMutuallyExclusiveSetErrors (
524524 meaningfulErrors . OfType < MutuallyExclusiveSetError > ( ) ) ;
525525 if ( mutuallyErrs . Length > 0 )
@@ -619,8 +619,25 @@ public override string ToString()
619619 . ToString ( ) ;
620620 }
621621
622- private static void AddLine ( StringBuilder builder , string value , int maximumLength )
622+ internal static void AddLine ( StringBuilder builder , string value , int maximumLength )
623623 {
624+ if ( builder == null )
625+ {
626+ throw new ArgumentNullException ( nameof ( builder ) ) ;
627+ }
628+
629+ if ( value == null )
630+ {
631+ throw new ArgumentNullException ( nameof ( value ) ) ;
632+ }
633+
634+ if ( maximumLength < 1 )
635+ {
636+ throw new ArgumentOutOfRangeException ( nameof ( value ) ) ;
637+ }
638+
639+ value = value . Trim ( ) ;
640+
624641 builder . AppendWhen ( builder . Length > 0 , Environment . NewLine ) ;
625642 do
626643 {
0 commit comments