Make it easier to configure HelpText by NeilMacMullen · Pull Request #458 · commandlineparser/commandline

The purpose of this change is to simplify configuration of the help-text output.

The HelpText class has lots of useful flags for controlling the way output is displayed but they are currently cumbersome to access. This PR allows you to write code such as...


  var parser= Parser.Default
                      .SetHelpTextConfiguration(h => 
                        {
                           helptext .AddEnumValuesToHelpText = true;
                           helptext .AddDashesToOption= true;
                         }
                         );
          
)

In addition, the old MaximumDisplayWidth and TextWriter properties have been moved into the HelpTextConfiguration and exposed via a fluent API in Parser to avoid clients having to access too many of the class internals so you can write..

 var p = Parser.Default
                .SetDisplayWidth(80,WidthPolicy.FitToScreen)
                .SetTextWriter(help)
                .SetHelpTextConfiguration(h => h.AddEnumValuesToHelpText = true);
 

The old config accessors are still provided as a backwards compatibility measure. but should be deprecated IMHO.