Skip to content

Commit

Permalink
docs(parser): Fix ArgMatches::value_source documentation
Browse files Browse the repository at this point in the history
  • Loading branch information
epage committed Feb 15, 2022
1 parent b171802 commit 15c7abb
Showing 1 changed file with 3 additions and 6 deletions.
9 changes: 3 additions & 6 deletions src/parse/matches/arg_matches.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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
///
Expand All @@ -638,15 +635,15 @@ impl ArgMatches {
/// # Examples
///
/// ```rust
/// # use clap::{Command, Arg};
/// # use clap::{Command, Arg, ValueSource};
/// let m = Command::new("myprog")
/// .arg(Arg::new("debug")
/// .short('d'))
/// .get_matches_from(vec![
/// "myprog", "-d"
/// ]);
///
/// assert!(m.is_present("debug"));
/// assert_eq!(m.value_source("debug"), Some(ValueSource::CommandLine));
/// ```
///
/// [`default_value`]: crate::Arg::default_value()
Expand Down

0 comments on commit 15c7abb

Please sign in to comment.