-
Notifications
You must be signed in to change notification settings - Fork 481
Incorrect help text if AutoVersion = false #414
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
Comments
Just experienced the exact same. Would be nice if this could be fixed. I tried fiddling with customization of help texts to see if I could suppress the version help text, but there is almost no documentation of help text customization - at least not enough to make it useful for people who are not extremely familiar with the CommandLineParser source code. |
+1, we experiencing the same problem |
Your .Net Fiddle helped me, and yes it does work. But I still don't think
it works very intuitively. In my view, when I set AutoVersion=false in
ParserSettings, then I expect "version" to be removed from help text as
well... automatically. But this is not how it works (I just tested in
2.5.0). I have to do like you show in the Fiddle and add all the
HelpText.AutoBuild code and specificly set AutoVersion=false just to
suppress it from being shown i help text. So what I'm saying is, that I
have to set AutoVersion=false in both ParserSettings and HelpText.AutoBuild
for it to work. I feel that is a bug.
…On Sun, Jun 23, 2019 at 11:21 PM Mohamed Hassan ***@***.***> wrote:
I test the custom help in v2.5.0 with AutoVersion = false and
`AutoHelp=false' and Version /Help are not displayed.
This means that it works fine in v2.5.0
Can you check this online Demo <https://dotnetfiddle.net/vk7WEO> with
example how to configure HelpText
|
@pihalve , Yes, configuration of AutoHelp should be in one Place and I consider it a bug. |
@pihalve
Do you mean :
|
@moh-hassan Yeah, well I mean configuring it in just one place, so when I have something like: |
@pihalve |
This issue is resolved in V2.6.0
Try it online |
This is not fixed in v2.6.0. It still shows Simple repro code:
|
Hiding --version and --help is configured in HelpText not in the Parser This is working in v2.6.0: helpText= HelpText.AutoBuild(result, h =>
{
h.AutoVersion =false; //hide --version
h.AutoHelp =false; // hide --help
return HelpText.DefaultParsingErrorsHandler(result, h);
}, e=>e); |
OK, so if I understand correctly, |
@loop-evgeny |
Well, I would expect that if |
Do you think that we remove |
No, I think they're useful. For my application --version is meaningless and I don't care about following GNU standards, but AutoHelp is still useful, so I want to set AutoVersion = false, but AutoHelp = true. |
Just for information, this is the original PR that implement the feature and its reference to issues. |
If you configure the Parser with ParserSettings.AutoVersion=false, the help text still displays the line:
--version Display version information.
The text was updated successfully, but these errors were encountered: