pub struct ToolInvocation<'a> {
pub tool: &'a str,
pub subcommand: Vec<&'a str>,
pub rest: Vec<&'a str>,
pub global_flags: Vec<&'a str>,
pub leaf_flags: Vec<&'a str>,
}Expand description
Structured representation of a single tool invocation extracted from a
PeeledCommand. All string fields borrow from the source PeeledCommand
to avoid heap allocation in the hot approval-gate path.
Fields§
§tool: &'a strLowercase basename of the matched tool (e.g. "git").
Borrows from PeeledCommand::primary.
subcommand: Vec<&'a str>The subcommand chain, up to max_depth non-flag positionals after the
global flags. E.g. ["stash", "list"] for git -C /tmp stash list.
rest: Vec<&'a str>Non-flag positionals after the subcommand chain (the “rest” args like
branch names, file paths, refs). E.g. ["origin", "main"] for
git push origin main.
global_flags: Vec<&'a str>Raw tokens stripped as global flags (including value tokens for
TakesValue specs). E.g. ["-C", "/tmp"] for git -C /tmp ….
leaf_flags: Vec<&'a str>Flag tokens appearing after the subcommand chain, used by F2’s
leaf-flag escalation (e.g. "--hard" in git reset --hard HEAD).
Trait Implementations§
Source§impl<'a> Clone for ToolInvocation<'a>
impl<'a> Clone for ToolInvocation<'a>
Source§fn clone(&self) -> ToolInvocation<'a>
fn clone(&self) -> ToolInvocation<'a>
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read more