pub struct TargetArgs {
pub config: Option<PathBuf>,
pub apply: bool,
pub dry_run: bool,
pub uninstall: bool,
pub binary: Option<PathBuf>,
pub hook: Option<HookKind>,
pub force: bool,
}Expand description
Shared per-target args. Constructed identically for every target so the dispatch table can pull them out generically.
Fields§
§config: Option<PathBuf>Override the default config path (the home-dir resolution).
REQUIRED for tests so they never touch ~/.claude/settings.json
on the host machine.
apply: boolActually write the file. Without --apply, the installer
runs in dry-run mode (the default) and prints what would change.
Mutually exclusive with --dry-run. Combine with --uninstall
to actually remove the managed block.
dry_run: boolForce dry-run mode. This is the default, so the flag is mostly
useful in scripts that want to make the no-write contract
explicit. Mutually exclusive with --apply.
uninstall: boolRemove the managed block instead of installing it. Default mode
is dry-run; pair with --apply to actually delete the block.
binary: Option<PathBuf>Override the resolved ai-memory binary path written into the
generated config’s command field. By default the installer
uses the binary’s own current_exe() if ai-memory is not on
$PATH, otherwise the bare string ai-memory.
hook: Option<HookKind>Install a harness-side hook variant in place of the default
managed block. Supported value: pretool — installs Claude
Code’s PreToolUse hook routing every Bash / Edit / Write tool
call through memory_check_agent_action (v0.7.0 policy-engine
item 2, issue #691).
Only meaningful for claude-code; other targets reject this
flag with a clear error.
force: boolWhen installing a hook (--hook), overwrite any pre-existing
entry whose matcher / tool shape conflicts with ours.
Without --force, the installer refuses to clobber a
differing-but-similar config and points the operator at this
flag in the stderr warning.
Trait Implementations§
Source§impl Args for TargetArgs
impl Args for TargetArgs
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
Command so it can instantiate self via
FromArgMatches::update_from_arg_matches_mut Read moreSource§impl Clone for TargetArgs
impl Clone for TargetArgs
Source§fn clone(&self) -> TargetArgs
fn clone(&self) -> TargetArgs
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read moreSource§impl Debug for TargetArgs
impl Debug for TargetArgs
Source§impl Default for TargetArgs
impl Default for TargetArgs
Source§fn default() -> TargetArgs
fn default() -> TargetArgs
Source§impl FromArgMatches for TargetArgs
impl FromArgMatches for TargetArgs
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>
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>
ArgMatches to self.Auto Trait Implementations§
impl Freeze for TargetArgs
impl RefUnwindSafe for TargetArgs
impl Send for TargetArgs
impl Sync for TargetArgs
impl Unpin for TargetArgs
impl UnsafeUnpin for TargetArgs
impl UnwindSafe for TargetArgs
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
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> ErasedDestructor for Twhere
T: 'static,
Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
Source§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more