-
Notifications
You must be signed in to change notification settings - Fork 116
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
Showing help on empty with inline subcommands #450
Comments
The prefs mod
|
Hey. Thanks for the quick response! Apologies. I classified the problem inadequately, I now realize. You're right. Help-on-empty for the subcommand does indeed show the usage line referencing the subcommand and any global options. What it does not seem to show are the subcommands themselves. That is, at the top level there's a grouping listing all next level commands:
Now I was expecting and trying to get the subparser to behave similarly — show available commands next level down. In the example we're playing with here, that'd be:
Thanks! |
Ahh I see now. When subparser inline is on, the subcommand is just included as a component of the parent parser. The parent parser isn't at its start though, so the showHelpOnEmpty case isn't being activated. Interesting little edge case there. This should be fixable by included a bit more information in the result of searchArg and stepParser. |
I have a fix and tests. The code is too ugly to push for now, but I'll see if I can get something acceptable next weekend. |
Great. Thank you! |
Hey again! Am I mistaken if I say the fix you did back in 2022 has never made it to |
Hey again!
Hope your spring is going swell.
Do you have some tips on how to achieve showing help-on-empty when subcommands and subparsers are involved? That is, given something that contains the following:
..I'm trying to achieve that invoking
./program foo
would print out the help with its subcommands (bar
) along with local and global options. This withOpt.prefBacktrack = Opt.SubparserInline
.Right now I'm seeing
./program
showing the top level commands (foo
), however./program foo
erring with:Thanks in advance!
The text was updated successfully, but these errors were encountered: