Skip to main content

is_rewritable_command

Function is_rewritable_command 

Source
pub fn is_rewritable_command(cmd: &str) -> bool
Expand description

Check if a command string matches a rewritable prefix (for hook handlers). Excludes FileRead (handled separately in hook_handlers).

Handles common shell patterns:

  • Bare command: git status
  • Env-var prefixed: PYTHONPATH=src python script.py
  • Path-qualified: ./.venv/bin/python, /usr/bin/python3