natemcmaster / CommandLineUtils

Command line parsing and utilities for .NET

Home Page:https://natemcmaster.github.io/CommandLineUtils/

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Custom IHelpTextGenerator not loaded when using builder.RunCommandLineApplicationAsync extension method

d1820 opened this issue · comments

Adding a custom IHelpTextGenerator is not honored when using the McMaster.Extensions.Hosting.CommandLine extensions. The default help generator is still used.

The breakpoint is hit to set the custom generator but the output is still for the default help generator. Also no breakpoints are hit in the custom generator aside from the constuctor

 var result = await builder.RunCommandLineApplicationAsync<KbxtCliCmd>(args, app => { 
                    app.HelpTextGenerator = new HelpGeneratorAscii();
                });

Versions

<PackageReference Include="McMaster.Extensions.CommandLineUtils" Version="3.1.0" />
    <PackageReference Include="McMaster.Extensions.Hosting.CommandLine" Version="3.1.0" />

also tried latest version

<PackageReference Include="McMaster.Extensions.CommandLineUtils" Version="4.0.0" />
    <PackageReference Include="McMaster.Extensions.Hosting.CommandLine" Version="4.0.0" />

Expected behavior
The custom HelpGenerator should be used

Screenshots
Standard Output
image

Expected ascii table pipes at the beginning and end of each line

Marking as “help wanted”. I would accept a pull request to fix this.

This issue has been automatically marked as stale because it has no recent activity. It will be closed if no further activity occurs. Please comment if you believe this should remain open, otherwise it will be closed in 14 days. Thank you for your contributions to this project.

Closing due to inactivity.
If you are looking at this issue in the future and think it should be reopened, please make a commented here and mention natemcmaster so he sees the notification.