Replies: 1 comment
-
Custom subcommand actions have been brought up from time to time but no serious design work has been done. We don't even have an issue for it yet. One of the complexities to that |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
I'm trying to make a custom format (optional json output) for an explicit
help
subcommand rather than the normal--help
and implicit help message when not specifying a subcommand. I've got it mostly working with:This works as expected, but my problem is that all the
Help
command does is print the available subcommands in a different format to stdout and then exit, and myMsg
which is deeply nested is later passed to other modules which makesSubcommandOrHelp
very leaky (by that point I would've already exited the program, so I have to putunreachable()!
s). The other problem is that handling it is verbose and requires getting the exact path of the subcommand (and I want to reuse this for multiple different subcommands):I think a custom subcommand value parser will solve both of these issues, does anyone know if something like that exists or if there's an alternative approach that might work?
Beta Was this translation helpful? Give feedback.
All reactions