Skip to content

Commit

Permalink
docs: Link to exit code info
Browse files Browse the repository at this point in the history
  • Loading branch information
sourcefrog committed Jan 15, 2024
1 parent b250c0b commit 8c83971
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 6 deletions.
6 changes: 3 additions & 3 deletions clap_builder/src/builder/command.rs
Original file line number Diff line number Diff line change
Expand Up @@ -588,7 +588,7 @@ impl Command {
Error::raw(kind, message).format(self)
}

/// Parse [`env::args_os`], exiting on failure.
/// Parse [`env::args_os`], [exiting][Error::exit] on failure.
///
/// # Panics
///
Expand All @@ -610,7 +610,7 @@ impl Command {
self.get_matches_from(env::args_os())
}

/// Parse [`env::args_os`], exiting on failure.
/// Parse [`env::args_os`], [exiting][Error::exit] on failure.
///
/// Like [`Command::get_matches`] but doesn't consume the `Command`.
///
Expand Down Expand Up @@ -670,7 +670,7 @@ impl Command {
self.try_get_matches_from(env::args_os())
}

/// Parse the specified arguments, exiting on failure.
/// Parse the specified arguments, [exiting][Error::exit] on failure.
///
/// **NOTE:** The first argument will be parsed as the binary name unless
/// [`Command::no_binary_name`] is used.
Expand Down
6 changes: 3 additions & 3 deletions clap_builder/src/derive.rs
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ use std::ffi::OsString;
///
/// **NOTE:** Deriving requires the `derive` feature flag
pub trait Parser: FromArgMatches + CommandFactory + Sized {
/// Parse from `std::env::args_os()`, exit on error
/// Parse from `std::env::args_os()`, [exit][Error::exit] on error.
fn parse() -> Self {
let mut matches = <Self as CommandFactory>::command().get_matches();
let res = <Self as FromArgMatches>::from_arg_matches_mut(&mut matches)
Expand All @@ -43,7 +43,7 @@ pub trait Parser: FromArgMatches + CommandFactory + Sized {
<Self as FromArgMatches>::from_arg_matches_mut(&mut matches).map_err(format_error::<Self>)
}

/// Parse from iterator, exit on error
/// Parse from iterator, [exit][Error::exit] on error.
fn parse_from<I, T>(itr: I) -> Self
where
I: IntoIterator<Item = T>,
Expand Down Expand Up @@ -72,7 +72,7 @@ pub trait Parser: FromArgMatches + CommandFactory + Sized {
<Self as FromArgMatches>::from_arg_matches_mut(&mut matches).map_err(format_error::<Self>)
}

/// Update from iterator, exit on error
/// Update from iterator, [exit][Error::exit] on error.
fn update_from<I, T>(&mut self, itr: I)
where
I: IntoIterator<Item = T>,
Expand Down

0 comments on commit 8c83971

Please sign in to comment.