-
-
Notifications
You must be signed in to change notification settings - Fork 1.1k
Description
Discussed in #3863
Originally posted by cd-work June 22, 2022
I'd like to write an external subcommand that accepts any parameter and forwards it, however it should also still be documented as subcommand.
I think this is probably a pretty common scenario, since you usually have some way to know which external subcommands are available even if you do not know their exact parameters. I do not want to allow just any subcommand, I have a list which I want to accept with generic parameters, everything else should still cause a failure.
I've tried using ignore_errors(true), but that only seems to work globally and not on the subcommands themselves. Otherwise it could be used to just accept parameters.
I've also used various combinations of allowing hyphen values and multiple values, but none of them seem to allow for the first argument to have two hyphens.
I only care about the subcommands documentation and description on the toplevel, since bin subcommand --help should already be forwarded to the subcommand and not handled by clap. This is also a scenario where built-in subcommands and flags exist already, so it's not only external subcommands I'm worried about.