pub enum GuardCommand {
Hook(GuardHookArgs),
}Expand description
The guard subcommands: one today, hook, which a provider’s pre-tool hook runs before
every write; an unknown subcommand is refused rather than read as a path.
use majordomus_cli::cli::{Cli, Command, GuardCommand};
use clap::Parser;
let cli = Cli::try_parse_from(["majordomus", "guard", "hook"]).unwrap();
let Command::Guard(guard) = cli.command else { panic!("expected `guard`") };
assert!(matches!(guard.command, GuardCommand::Hook(_)));
assert!(Cli::try_parse_from(["majordomus", "guard", "docs/a.md"]).is_err());Variants§
Hook(GuardHookArgs)
Judge the edit a provider’s pre-tool payload (on stdin) is about to make; exit 2 with the reason and the remedy when no claim covers it, 0 otherwise
Trait Implementations§
Source§impl Debug for GuardCommand
impl Debug for GuardCommand
Source§impl FromArgMatches for GuardCommand
impl FromArgMatches for GuardCommand
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<'b>(
&mut self,
__clap_arg_matches: &mut ArgMatches,
) -> Result<(), Error>
fn update_from_arg_matches_mut<'b>( &mut self, __clap_arg_matches: &mut ArgMatches, ) -> Result<(), Error>
Assign values from
ArgMatches to self.Source§impl Subcommand for GuardCommand
impl Subcommand for GuardCommand
Source§fn augment_subcommands<'b>(__clap_app: Command) -> Command
fn augment_subcommands<'b>(__clap_app: Command) -> Command
Source§fn augment_subcommands_for_update<'b>(__clap_app: Command) -> Command
fn augment_subcommands_for_update<'b>(__clap_app: Command) -> Command
Append to [
Command] so it can instantiate self via
[FromArgMatches::update_from_arg_matches_mut] Read moreSource§fn has_subcommand(__clap_name: &str) -> bool
fn has_subcommand(__clap_name: &str) -> bool
Test whether
Self can parse a specific subcommandAuto Trait Implementations§
impl Freeze for GuardCommand
impl RefUnwindSafe for GuardCommand
impl Send for GuardCommand
impl Sync for GuardCommand
impl Unpin for GuardCommand
impl UnsafeUnpin for GuardCommand
impl UnwindSafe for GuardCommand
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