From 625c201f657f091d0eb627c84db3e68eec56d507 Mon Sep 17 00:00:00 2001 From: KBR9 Date: Sat, 24 Oct 2020 15:47:04 +0200 Subject: [PATCH] Add docs about conflicts_with_all usage in yaml add note about conflicts_with yaml option add note about conflicts_with yaml option fix wrapping remove unnecessary sentence remove note from conflicts_with --- clap.schema.json | 12 ++++++++---- src/build/arg/mod.rs | 5 ++++- 2 files changed, 12 insertions(+), 5 deletions(-) diff --git a/clap.schema.json b/clap.schema.json index 09e83195..4fa922bd 100644 --- a/clap.schema.json +++ b/clap.schema.json @@ -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" diff --git a/src/build/arg/mod.rs b/src/build/arg/mod.rs index 2de73c04..3b8b8680 100644 --- a/src/build/arg/mod.rs +++ b/src/build/arg/mod.rs @@ -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