Skip to content

Commit ead076f

Browse files
committed
docs: updates the docs to reflect changes to global args and that global args values can now be propagated back up the stack
1 parent cbd09c7 commit ead076f

File tree

1 file changed

+4
-8
lines changed

1 file changed

+4
-8
lines changed

src/args/arg.rs

+4-8
Original file line numberDiff line numberDiff line change
@@ -2099,14 +2099,10 @@ impl<'a, 'b> Arg<'a, 'b> {
20992099

21002100
/// Specifies that an argument can be matched to all child [`SubCommand`]s.
21012101
///
2102-
/// **NOTE:** Global arguments *only* propagate down, **not** up (to parent commands)
2103-
///
2104-
/// **NOTE:** Global arguments *cannot* be [required].
2105-
///
2106-
/// **NOTE:** Global arguments, when matched, *only* exist in the command's matches that they
2107-
/// were matched to. For example, if you defined a `--flag` global argument in the top most
2108-
/// parent command, but the user supplied the arguments `top cmd1 cmd2 --flag` *only* `cmd2`'s
2109-
/// [`ArgMatches`] would return `true` if tested for [`ArgMatches::is_present("flag")`].
2102+
/// **NOTE:** Global arguments *only* propagate down, **not** up (to parent commands), however
2103+
/// their values once a user uses them will be propagated back up to parents. In effect, this
2104+
/// means one should *define* all global arguments at the top level, however it doesn't matter
2105+
/// where the user *uses* the global argument.
21102106
///
21112107
/// # Examples
21122108
///

0 commit comments

Comments
 (0)