Fix issues for HelpText.AutoBuild configuration (issues #224 , # 259) by moh-hassan · Pull Request #467 · commandlineparser/commandline

HelpText.AutoBuild can't apply setting on HelpText to add AdditionalNewLineAfterOption and other setting.
These setting are applied only when parser raise parsing errors.
This PR fix this bug and fix issue #224 , #259 .
You have a complete control on HelpText configuration in custom help.
Also, new extension methods IsHelp() /IsVersion() is added to simplify checking errors if it have help/version option.

        var parser = new Parser(x =>
        {
            x.HelpWriter = null;               
        });
        var result = parser.ParseArguments<Simple_Options>(new[]{"--help"});
        //generate custom help 
        result .WithNotParsed(errs =>
        {               
            var helpText = HelpText.AutoBuild(result,
                h =>
                {
				    //configure help
                    h.AdditionalNewLineAfterOption = false;
                    return h;
                }
                , e => e);
             //print help screen
            Console.WriteLine(helpText);
             
        });