Skip to content

Commit fd41141

Browse files
committed
docs: Clarify args_override_self
Fixes #4357
1 parent 59bf166 commit fd41141

File tree

2 files changed

+6
-3
lines changed

2 files changed

+6
-3
lines changed

src/builder/arg.rs

+2-2
Original file line numberDiff line numberDiff line change
@@ -3521,6 +3521,8 @@ impl Arg {
35213521
///
35223522
/// **NOTE** [`Arg::exclusive(true)`] allows specifying an argument which conflicts with every other argument.
35233523
///
3524+
/// **NOTE:** All arguments implicitly conflict with themselves.
3525+
///
35243526
/// # Examples
35253527
///
35263528
/// ```rust
@@ -3623,8 +3625,6 @@ impl Arg {
36233625
///
36243626
/// **NOTE:** Overriding an argument implies they [conflict][Arg::conflicts_with`].
36253627
///
3626-
/// **NOTE:** All arguments implicitly override themselves.
3627-
///
36283628
/// # Examples
36293629
///
36303630
/// ```rust

src/builder/command.rs

+4-1
Original file line numberDiff line numberDiff line change
@@ -975,7 +975,10 @@ impl Command {
975975
}
976976
}
977977

978-
/// Specifies that all arguments override themselves.
978+
/// Replace prior occurrences of arguments rather than error
979+
///
980+
/// For any argument that would conflict with itself by default (e.g.
981+
/// [`ArgAction::Set`][ArgAction::Set], it will now override itself.
979982
///
980983
/// This is the equivalent to saying the `foo` arg using [`Arg::overrides_with("foo")`] for all
981984
/// defined arguments.

0 commit comments

Comments
 (0)