Closed JayiceZ closed 2 years ago
From what I've seen so far, clap allows validation of relationship of args and groups but subcommands are effectively in another namespace, preventing them from interacting with that system.
In clap3, there is App::error
to create clap-like errors for custom validation. There is also interest in generalizing clap's mechanisms so people are less likely to run into hurdles like this.
This is an enhancement, and structopt is now feature frozen.
Hi, I am new to structopt. And I am not sure is it a structopt issue or a clap issue? Here is the situation I met:
I defined it, like:
And what I want is: When
Test
SubCommand is set, one ofcat
anddog
should be set(or it means that they are in aGroup
, and the group is required whenTest
is set); And whenDebug
is set,host
should be set.I have read the doc and examples, but I am not sure how to implement this function? ðŸ˜