Skip to content

Commit

Permalink
Merge #2183
Browse files Browse the repository at this point in the history
2183: Add `conflicts_with_all` note to docs r=pksunkara a=cbr9



Co-authored-by: KBR9 <cabero96@protonmail.com>
  • Loading branch information
bors[bot] and cbr9 committed Oct 24, 2020
2 parents 2f5b1e6 + 625c201 commit 04fd336
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 5 deletions.
12 changes: 8 additions & 4 deletions clap.schema.json
Original file line number Diff line number Diff line change
Expand Up @@ -69,10 +69,14 @@
"type": "boolean"
},
"conflicts_with": {
"type": "string"
},
"conflicts_with_all": {
"$ref": "#/structures/arrayStrUnique"
"anyOf": [
{
"type": "string"
},
{
"$ref": "#/structures/arrayStrUnique"
}
]
},
"default_value": {
"type": "string"
Expand Down
5 changes: 4 additions & 1 deletion src/build/arg/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -885,7 +885,7 @@ impl<'help> Arg<'help> {
self
}

/// The same as [`Arg::conflicts_with`] but allows specifying multiple two-way conlicts per
/// The same as [`Arg::conflicts_with`] but allows specifying multiple two-way conflicts per
/// argument.
///
/// **NOTE:** Conflicting rules take precedence over being required by default. Conflict rules
Expand All @@ -895,6 +895,9 @@ impl<'help> Arg<'help> {
/// (i.e. if A conflicts with B, defining A.conflicts_with(B) is sufficient. You do not need
/// need to also do B.conflicts_with(A))
///
/// **NOTE:** This option does not exist when using a YAML configuration file. Using [`Arg::conflicts_with`]
/// followed by an array of strings will achieve the equivalent effect.
///
/// **NOTE:** [`Arg::exclusive(true)`] allows specifying an argument which conflicts with every other argument.
///
/// # Examples
Expand Down

0 comments on commit 04fd336

Please sign in to comment.