From 5488bcfa30255c59f931f1248e854c0087b2b969 Mon Sep 17 00:00:00 2001 From: Ed Page Date: Fri, 16 Aug 2024 13:15:20 -0500 Subject: [PATCH] docs(derive): Connect more dots for Args/Subcommand --- clap_builder/src/derive.rs | 20 ++++++++++++-------- 1 file changed, 12 insertions(+), 8 deletions(-) diff --git a/clap_builder/src/derive.rs b/clap_builder/src/derive.rs index 9d45b613dba..3c4e70b41f5 100644 --- a/clap_builder/src/derive.rs +++ b/clap_builder/src/derive.rs @@ -216,15 +216,17 @@ pub trait Args: FromArgMatches + Sized { fn group_id() -> Option { 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; } @@ -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;