You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
This is a small idea as it relates to the use of structopt in production environments.
It would be useful if a struct, in a multi-nested struct configuration, could be flagged to require all of its options to be provided whenever at least one of them is, or none at all. The usefulness of this is to prevent partial configurations in production environments which can lead to difficult-to-debug issues.
The feature would be used by specifying all_or_none in the struct trait's parameters:
#[derive(StructOpt)]#[StructOpt(all_or_none)]
This saves having to write many required_if statements for all permutations of default parameters. If you specified a single parameter, but not other required parameters, regardless of whether they have defaults, the argument parsing would fail.
The text was updated successfully, but these errors were encountered:
This is a small idea as it relates to the use of structopt in production environments.
It would be useful if a struct, in a multi-nested struct configuration, could be flagged to require all of its options to be provided whenever at least one of them is, or none at all. The usefulness of this is to prevent partial configurations in production environments which can lead to difficult-to-debug issues.
The feature would be used by specifying
all_or_none
in the struct trait's parameters:This saves having to write many
required_if
statements for all permutations of default parameters. If you specified a single parameter, but not other required parameters, regardless of whether they have defaults, the argument parsing would fail.The text was updated successfully, but these errors were encountered: