pub struct GuardArgs {
pub command: GuardCommand,
}Expand description
majordomus guard: the edit guard (I2735).
use majordomus_cli::cli::{Cli, Command, GuardArgs, GuardCommand};
use clap::Parser;
let cli = Cli::try_parse_from(["majordomus", "guard", "hook", "--provider", "claude-code"]).unwrap();
let Command::Guard(guard) = cli.command else { panic!("expected `guard`") };
let GuardArgs { command: GuardCommand::Hook(hook) } = guard;
assert_eq!(hook.provider, "claude-code");
// the group has no behaviour of its own
assert!(Cli::try_parse_from(["majordomus", "guard"]).is_err());Fields§
§command: GuardCommandhook.
Trait Implementations§
Source§impl Args for GuardArgs
impl Args for GuardArgs
Source§fn group_id() -> Option<Id>
fn group_id() -> Option<Id>
Report the [
ArgGroup::id][crate::ArgGroup::id] for this set of argumentsSource§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 FromArgMatches for GuardArgs
impl FromArgMatches for GuardArgs
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 GuardArgs
impl RefUnwindSafe for GuardArgs
impl Send for GuardArgs
impl Sync for GuardArgs
impl Unpin for GuardArgs
impl UnsafeUnpin for GuardArgs
impl UnwindSafe for GuardArgs
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