pub struct ConfigArgs {
pub scope: Option<String>,
pub action: Option<ConfigSubcommand>,
}Expand description
Clap-derived args for the config subcommand group.
Embed this into your app’s clap derive:
ⓘ
#[derive(Parser)]
struct Cli {
#[command(subcommand)]
command: Commands,
}
#[derive(Subcommand)]
enum Commands {
Config(ConfigArgs),
}Fields§
§scope: Option<String>Target a named persist scope (e.g. “local”, “global”).
For set/unset: selects which config file to write to. Defaults to the
first scope configured on the builder.
For list/get: reads from that scope’s config file only (instead of
the merged resolved view).
action: Option<ConfigSubcommand>Implementations§
Source§impl ConfigArgs
impl ConfigArgs
Sourcepub fn into_action(self) -> ConfigAction
pub fn into_action(self) -> ConfigAction
Convert clap-parsed args into a framework-agnostic ConfigAction.
Bare config (no subcommand) and explicit config list both map to
ConfigAction::List. The --scope flag is threaded through to all
variants except Gen.
Trait Implementations§
Source§impl Args for ConfigArgs
impl Args for ConfigArgs
Source§fn augment_args<'b>(__clap_app: Command) -> Command
fn augment_args<'b>(__clap_app: Command) -> Command
Source§fn augment_args_for_update<'b>(__clap_app: Command) -> Command
fn augment_args_for_update<'b>(__clap_app: Command) -> Command
Append to
Command so it can instantiate self via
FromArgMatches::update_from_arg_matches_mut Read moreSource§impl Debug for ConfigArgs
impl Debug for ConfigArgs
Source§impl FromArgMatches for ConfigArgs
impl FromArgMatches for ConfigArgs
Source§fn from_arg_matches(__clap_arg_matches: &ArgMatches) -> Result<Self, Error>
fn from_arg_matches(__clap_arg_matches: &ArgMatches) -> Result<Self, Error>
Source§fn from_arg_matches_mut(
__clap_arg_matches: &mut ArgMatches,
) -> Result<Self, Error>
fn from_arg_matches_mut( __clap_arg_matches: &mut ArgMatches, ) -> Result<Self, Error>
Source§fn update_from_arg_matches(
&mut self,
__clap_arg_matches: &ArgMatches,
) -> Result<(), Error>
fn update_from_arg_matches( &mut self, __clap_arg_matches: &ArgMatches, ) -> Result<(), Error>
Assign values from
ArgMatches to self.Source§fn update_from_arg_matches_mut(
&mut self,
__clap_arg_matches: &mut ArgMatches,
) -> Result<(), Error>
fn update_from_arg_matches_mut( &mut self, __clap_arg_matches: &mut ArgMatches, ) -> Result<(), Error>
Assign values from
ArgMatches to self.Auto Trait Implementations§
impl Freeze for ConfigArgs
impl RefUnwindSafe for ConfigArgs
impl Send for ConfigArgs
impl Sync for ConfigArgs
impl Unpin for ConfigArgs
impl UnsafeUnpin for ConfigArgs
impl UnwindSafe for ConfigArgs
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more