Skip to content
Discussion options

You must be logged in to vote

We currently have two facilities

  • required_if_eq. The current argument becomes required if another argument equals a value
  • requires_if: The other argument becomes required if the current argument equals a value
  • required_unless_present: The current argument is required unless the other argument is present

but what you need is "the other argument's value is required to be XX if the current argument is present"

Without a high demand for it, I'm not thrilled with adding yet another argument relationship type until we generalize argument relations

As a workaround, you can catch this yourself and use clap to create the error message.

Replies: 2 comments 3 replies

Comment options

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

You must be logged in to vote
3 replies
@epage
Comment options

@jtmoon79
Comment options

@epage
Comment options

epage Jan 9, 2023
Maintainer

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
4 participants