Skip to content
Discussion options

You must be logged in to vote

I basically handle completions as another version of command line options, and then also include them in the main one by flattening. A bit meh, but kind of works.

I'm a bit confused as to how this is helping.

The core issue is that you have required arguments which are mutually exclusive with --completions. With the builder API, you'd use exclusive(true) on the completions argument and be done. With the derive API, the problem is that the derive has nothing to populate the required arguments with. A workaround is to make them Option but set required = true. This will make it so they will only be None when --completions is set.

e.g. changing

    /// AWS profile to use when calling `aws` CLI

Replies: 2 comments

Comment options

You must be logged in to vote
0 replies
Answer selected by dpc
Comment options

You must be logged in to vote
0 replies
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants