Skip to main content

extract_command_prefix

Function extract_command_prefix 

Source
pub fn extract_command_prefix(command: &str) -> String
Expand description

Extract a command prefix for auto-approval patterns.

For multi-word tools (e.g. cargo test, git status), returns the first two tokens. For single-word tools (e.g. eslint), returns one. Strips leading env var assignments and path prefixes.