#363 Add nested subcommand support for help#364
Conversation
I'm confused by this one, it still shows the wrong one, no?
|
97b8619 to
7d92f20
Compare
Hum, yeah, that's a bit weird.
The -h seems justified, but -V not so much?
Not a deal-breaker if it's only for the help command. Maybe though we should get rid of it and only support option 3 (-h, --help)? |
|
I jumped the gun implementing this. Going to mark as a draft and continue the discussion on #363 until we've settled on an ideal syntax; you raised some good points there that deserve to be addressed before we spend time on code review. Thanks for the rapid turnaround though! 😄 |
|
Got rid of the extraneous |
Correct, it's only for the help command. I personally really like the |
Sorry, missed this comment earlier! Was a copy+paste error on my part. I've updated the description with the correct output, after verifying that it accurately reflects what the CLI emits after being built with the latest commit for this PR. |
Yeah, good catch! I'll add it to this PR tomorrow if there are no objections. |
|
Sweet, this LGTM overall to me. IIUC, there's two remaining loose ends:
Anything else? |
|
I think that's it! With the latest commit, I fixed the I want to try to get autocomplete working for nested subcommands with |
|
Sounds good, can you just log a follow-up issue for the nested subcommand help auto-completion? |
|
Applied. Thanks a lot, @C0urante! |
|
Thanks Gunnar! Filed #370 as a follow-up for autocompletion of nested subcommands. |
Fixes #363
Augments the
helpcommand to process nested subcommands, and adds support for the-h/--helpflag to every subcommand.Before:
(This shows the usage info for
restart, even though we requested it forrestart connectors)After:
Before:
(Prints an error message about
-hbeing an unknown option)After:
There is one small drawback to this approach in that it adds a bit of noise to the usage summary for every command. Commands that accepted a single argument or flag now have info on one additional flag (
-h/--help).Autocomplete is supported, but only for top-level commands. This behavior mirrors current autocomplete support for the
helpcommand, which repeatedly recommends top-level commands even though only the first one is used. Ideally we could support autocomplete for nested subcommands, but this may be difficult to do with picocli.