Skip to content

Commit

Permalink
docs: Clarify behavior of Arg::multiple with options.
Browse files Browse the repository at this point in the history
  • Loading branch information
jimmycuadra committed Oct 30, 2015
1 parent c1f66b5 commit 434f497
Showing 1 changed file with 9 additions and 7 deletions.
16 changes: 9 additions & 7 deletions src/args/arg.rs
Original file line number Diff line number Diff line change
Expand Up @@ -677,13 +677,15 @@ impl<'n, 'l, 'h, 'g, 'p, 'r> Arg<'n, 'l, 'h, 'g, 'p, 'r> {
self
}

/// Specifies if the flag may appear more than once such as for multiple debugging
/// levels (as an example). `-ddd` for three levels of debugging, or `-d -d -d`.
/// When this is set to `true` you receive the number of occurrences the user supplied
/// of a particular flag at runtime.
///
/// **NOTE:** When setting this, any `takes_value` or `index` values you set
/// are ignored as flags cannot have a values or an `index`.
/// Specifies that the flag or option may appear more than once. For flags, this results
/// in the number of occurrences of the flag being recorded. For example `-ddd` would count as
/// three occurrences. The form `-d -d -d` would also be recognized as three occurrences. For
/// options, more than one value may be provided. The forms `--optional foo --optional bar`,
/// `--optional foo bar` and `-ofoo -obar` are all recognized, assuming the relevant `short`
/// and `long` option names have been set.
///
/// **NOTE:** When setting this, `index` is ignored as it only makes sense for positional
/// arguments.
///
///
/// # Examples
Expand Down

0 comments on commit 434f497

Please sign in to comment.