mirror of
https://github.com/clap-rs/clap
synced 2024-12-14 06:42:33 +00:00
feat(builder): Updated min_value and required docs
This commit is contained in:
parent
02b4fed2aa
commit
a678baa4f4
1 changed files with 6 additions and 0 deletions
|
@ -1295,6 +1295,11 @@ impl<'help> Arg<'help> {
|
||||||
/// [`Arg::multiple_occurrences(true)`] because there is no way to determine the difference between multiple
|
/// [`Arg::multiple_occurrences(true)`] because there is no way to determine the difference between multiple
|
||||||
/// occurrences and multiple values.
|
/// occurrences and multiple values.
|
||||||
///
|
///
|
||||||
|
/// **NOTE:** Passing a non-zero value is not the same as specifying [`Arg::required(true)`].
|
||||||
|
/// This is due to min and max validation only being performed for present arguments,
|
||||||
|
/// marking them as required will thus perform validation and a min value of 1
|
||||||
|
/// is unnecessary, ignored if not required.
|
||||||
|
///
|
||||||
/// # Examples
|
/// # Examples
|
||||||
///
|
///
|
||||||
/// ```rust
|
/// ```rust
|
||||||
|
@ -1340,6 +1345,7 @@ impl<'help> Arg<'help> {
|
||||||
/// assert_eq!(res.unwrap_err().kind(), ErrorKind::TooFewValues);
|
/// assert_eq!(res.unwrap_err().kind(), ErrorKind::TooFewValues);
|
||||||
/// ```
|
/// ```
|
||||||
/// [`Arg::multiple_occurrences(true)`]: Arg::multiple_occurrences()
|
/// [`Arg::multiple_occurrences(true)`]: Arg::multiple_occurrences()
|
||||||
|
/// [`Arg::required(true)`]: Arg::required()
|
||||||
#[inline]
|
#[inline]
|
||||||
#[must_use]
|
#[must_use]
|
||||||
pub fn min_values(mut self, qty: usize) -> Self {
|
pub fn min_values(mut self, qty: usize) -> Self {
|
||||||
|
|
Loading…
Reference in a new issue