docs(derive): Connect more dots for Args/Subcommand

This commit is contained in:
Ed Page 2024-08-16 13:15:20 -05:00
parent 6013ad4f67
commit 5488bcfa30

View file

@ -216,15 +216,17 @@ pub trait Args: FromArgMatches + Sized {
fn group_id() -> Option<crate::Id> { fn group_id() -> Option<crate::Id> {
None 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; 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)]` /// This is used to implement `#[command(flatten)]`
/// ///
/// See also [`CommandFactory`]. /// See also [`CommandFactory::command_for_update`].
fn augment_args_for_update(cmd: Command) -> Command; fn augment_args_for_update(cmd: Command) -> Command;
} }
@ -239,15 +241,17 @@ pub trait Args: FromArgMatches + Sized {
/// ///
/// **NOTE:** Deriving requires the `derive` feature flag /// **NOTE:** Deriving requires the `derive` feature flag
pub trait Subcommand: FromArgMatches + Sized { 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; 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)]` /// This is used to implement `#[command(flatten)]`
/// ///
/// See also [`CommandFactory`]. /// See also [`CommandFactory::command_for_update`].
fn augment_subcommands_for_update(cmd: Command) -> Command; fn augment_subcommands_for_update(cmd: Command) -> Command;
/// Test whether `Self` can parse a specific subcommand /// Test whether `Self` can parse a specific subcommand
fn has_subcommand(name: &str) -> bool; fn has_subcommand(name: &str) -> bool;