Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix issues for HelpText.AutoBuild configuration (issues #224 , # 259) #467

Merged
merged 4 commits into from
Jul 26, 2019
Merged

Fix issues for HelpText.AutoBuild configuration (issues #224 , # 259) #467

merged 4 commits into from
Jul 26, 2019

Conversation

moh-hassan
Copy link
Collaborator

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);
             
        });

@moh-hassan
Copy link
Collaborator Author

This PR also fix #414 and #455

@moh-hassan moh-hassan merged commit 2580024 into commandlineparser:develop Jul 26, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants