mirror of
https://github.com/clap-rs/clap
synced 2024-09-22 07:11:56 +00:00
Fix docs for Arg aliases (clap-rs/clap#3044)
This commit is contained in:
parent
700efb170a
commit
b95ced6fb3
1 changed files with 2 additions and 4 deletions
|
@ -579,7 +579,7 @@ impl<'help> Arg<'help> {
|
||||||
}
|
}
|
||||||
|
|
||||||
/// Allows adding a [`Arg`] alias that functions exactly like those defined with
|
/// Allows adding a [`Arg`] alias that functions exactly like those defined with
|
||||||
/// [`Arg::alias`], except that they are visible inside the help message.
|
/// [`Arg::short_alias`], except that they are visible inside the help message.
|
||||||
///
|
///
|
||||||
/// # Examples
|
/// # Examples
|
||||||
///
|
///
|
||||||
|
@ -596,7 +596,6 @@ impl<'help> Arg<'help> {
|
||||||
/// assert!(m.is_present("test"));
|
/// assert!(m.is_present("test"));
|
||||||
/// assert_eq!(m.value_of("test"), Some("coffee"));
|
/// assert_eq!(m.value_of("test"), Some("coffee"));
|
||||||
/// ```
|
/// ```
|
||||||
/// [`App::alias`]: Arg::short_alias()
|
|
||||||
pub fn visible_short_alias(mut self, name: char) -> Self {
|
pub fn visible_short_alias(mut self, name: char) -> Self {
|
||||||
assert!(name != '-', "short alias name cannot be `-`");
|
assert!(name != '-', "short alias name cannot be `-`");
|
||||||
|
|
||||||
|
@ -627,7 +626,7 @@ impl<'help> Arg<'help> {
|
||||||
}
|
}
|
||||||
|
|
||||||
/// Allows adding multiple [`Arg`] aliases that functions exactly like those defined
|
/// Allows adding multiple [`Arg`] aliases that functions exactly like those defined
|
||||||
/// with [`Arg::aliases`], except that they are visible inside the help message.
|
/// with [`Arg::short_aliases`], except that they are visible inside the help message.
|
||||||
///
|
///
|
||||||
/// # Examples
|
/// # Examples
|
||||||
///
|
///
|
||||||
|
@ -642,7 +641,6 @@ impl<'help> Arg<'help> {
|
||||||
/// ]);
|
/// ]);
|
||||||
/// assert!(m.is_present("test"));
|
/// assert!(m.is_present("test"));
|
||||||
/// ```
|
/// ```
|
||||||
/// [`App::aliases`]: Arg::short_aliases()
|
|
||||||
pub fn visible_short_aliases(mut self, names: &[char]) -> Self {
|
pub fn visible_short_aliases(mut self, names: &[char]) -> Self {
|
||||||
for n in names {
|
for n in names {
|
||||||
assert!(n != &'-', "short alias name cannot be `-`");
|
assert!(n != &'-', "short alias name cannot be `-`");
|
||||||
|
|
Loading…
Reference in a new issue