-
-
Notifications
You must be signed in to change notification settings - Fork 1.1k
Add option to hide help based on long/short #1235
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
Conversation
There is still an issue with the logic in parser.rs use_long_help. This causes invalid evaluation of whether to show/hide based on long or short help
@stevepentland, thanks for your PR! By analyzing the history of the files in this pull request, we identified @kbknapp to be a potential reviewer. |
First of all, thanks for tackling this! It looks really good so far! As for the issue, I'm not sure I understand. You're saying if someone uses If you add some tests I might be able to see the issue a little better. |
Sorry, I should have described the issue better, that's my bad. At this point However, when trying to use As for extra tests, I will add more to |
Ah ok I see now. I'm investigating a little more on my end to see what the issue may be, I'll let you know what I find. |
Ok, so I see what's going on now (at least the i.e. Old style when using
Without
(note the help text being printed on the line below). I'm personally fine with this change and dropping However, it is a somewhat in your face stylistic change and would like to hear a few other opinions before making that particular change. Back to the issue at hand, a simple way to keep the old functionality and fix this issue is to not only check if |
It does work, but it also brings up another potential issue: While there is no change when |
So long as it's documented I'm fine with it. I think the case to hide something from the long help only will be extremely rare, and already somewhat implies two different help messages (even if style isn't implied). |
@stevepentland let me know once you're good with it and I'll do the final review |
@kbknapp will do, should be soon. Just gotten side tracked |
@kbknapp I've gotten them both working, updated the check, and added docs stating that using these options will change how |
Looks good, thanks! 👍 |
Relates to #1064
I've added the enum variants and related setting methods to provide the functionality. However, the usage of Parser::use_long_help() is causing issues.
It seems that the linked method will not allow
use_long
to betrue
unless there is actually a long help value defined for theArg
. However, I noticed in help.rs that we would choose to use the desired long or short help based on what was specified during the run and the extra logic does not seem like it is really needed. However when I bypassed the code inparser.rs
, there were some failing tests.@kbknapp do you have any suggestions?
This change is