mirror of
https://github.com/clap-rs/clap
synced 2024-12-14 14:52:33 +00:00
Merge #2183
2183: Add `conflicts_with_all` note to docs r=pksunkara a=cbr9 Co-authored-by: KBR9 <cabero96@protonmail.com>
This commit is contained in:
commit
04fd3369d3
2 changed files with 12 additions and 5 deletions
|
@ -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"
|
||||
|
|
|
@ -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
|
||||
|
@ -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
|
||||
|
|
Loading…
Reference in a new issue