Skip to content

Commit

Permalink
docs(derive): Connect more dots for Args/Subcommand
Browse files Browse the repository at this point in the history
  • Loading branch information
epage committed Aug 16, 2024
1 parent 6013ad4 commit 5488bcf
Showing 1 changed file with 12 additions and 8 deletions.
20 changes: 12 additions & 8 deletions clap_builder/src/derive.rs
Original file line number Diff line number Diff line change
Expand Up @@ -216,15 +216,17 @@ pub trait Args: FromArgMatches + Sized {
fn group_id() -> Option<crate::Id> {
None
}
/// Append to [`Command`] so it can instantiate `Self`.
/// Append to [`Command`] so it can instantiate `Self` via
/// [`FromArgMatches::from_arg_matches_mut`]
///
/// See also [`CommandFactory`].
/// See also [`CommandFactory::command`].
fn augment_args(cmd: Command) -> Command;
/// Append to [`Command`] so it can update `self`.
/// Append to [`Command`] so it can instantiate `self` via
/// [`FromArgMatches::update_from_arg_matches_mut`]
///
/// This is used to implement `#[command(flatten)]`
///
/// See also [`CommandFactory`].
/// See also [`CommandFactory::command_for_update`].
fn augment_args_for_update(cmd: Command) -> Command;
}

Expand All @@ -239,15 +241,17 @@ pub trait Args: FromArgMatches + Sized {
///
/// **NOTE:** Deriving requires the `derive` feature flag
pub trait Subcommand: FromArgMatches + Sized {
/// Append to [`Command`] so it can instantiate `Self`.
/// Append to [`Command`] so it can instantiate `Self` via
/// [`FromArgMatches::from_arg_matches_mut`]
///
/// See also [`CommandFactory`].
/// See also [`CommandFactory::command`].
fn augment_subcommands(cmd: Command) -> Command;
/// Append to [`Command`] so it can update `self`.
/// Append to [`Command`] so it can instantiate `self` via
/// [`FromArgMatches::update_from_arg_matches_mut`]
///
/// This is used to implement `#[command(flatten)]`
///
/// See also [`CommandFactory`].
/// See also [`CommandFactory::command_for_update`].
fn augment_subcommands_for_update(cmd: Command) -> Command;
/// Test whether `Self` can parse a specific subcommand
fn has_subcommand(name: &str) -> bool;
Expand Down

0 comments on commit 5488bcf

Please sign in to comment.