mirror of
https://github.com/clap-rs/clap
synced 2024-12-13 06:12:40 +00:00
docs(parser): Fix ArgMatches::value_source documentation
This commit is contained in:
parent
b171802265
commit
15c7abb196
1 changed files with 3 additions and 6 deletions
|
@ -626,10 +626,7 @@ impl ArgMatches {
|
|||
self.args.contains_key(&id)
|
||||
}
|
||||
|
||||
/// Check if an argument was present at runtime.
|
||||
///
|
||||
/// *NOTE:* This will always return `true` if [`default_value`] has been set.
|
||||
/// [`occurrences_of`] can be used to check if a value is present at runtime.
|
||||
/// Report where argument value came from
|
||||
///
|
||||
/// # Panics
|
||||
///
|
||||
|
@ -638,7 +635,7 @@ impl ArgMatches {
|
|||
/// # Examples
|
||||
///
|
||||
/// ```rust
|
||||
/// # use clap::{Command, Arg};
|
||||
/// # use clap::{Command, Arg, ValueSource};
|
||||
/// let m = Command::new("myprog")
|
||||
/// .arg(Arg::new("debug")
|
||||
/// .short('d'))
|
||||
|
@ -646,7 +643,7 @@ impl ArgMatches {
|
|||
/// "myprog", "-d"
|
||||
/// ]);
|
||||
///
|
||||
/// assert!(m.is_present("debug"));
|
||||
/// assert_eq!(m.value_source("debug"), Some(ValueSource::CommandLine));
|
||||
/// ```
|
||||
///
|
||||
/// [`default_value`]: crate::Arg::default_value()
|
||||
|
|
Loading…
Reference in a new issue