pub fn evaluate_command(
command: &str,
config: &Config,
enabled_keywords: &[&str],
compiled_overrides: &CompiledOverrides,
allowlists: &LayeredAllowlist,
) -> EvaluationResultExpand description
Evaluate a command against all patterns and packs using precompiled overrides.
This is the main entry point for command evaluation. It performs all checks in the correct order and returns a structured result.
§Arguments
command- The raw command string to evaluateconfig- Loaded configuration with pack settingsenabled_keywords- Keywords from enabled packs for quick rejectioncompiled_overrides- Precompiled config overrides (avoids per-command regex compilation)
§Returns
An EvaluationResult indicating whether the command is allowed or denied,
with detailed pattern match information for denials.
§Performance
This function is optimized for the common case (allow):
- Quick rejection skips regex for 99%+ of commands
- Config overrides use precompiled regexes (no per-command compilation)
- Short-circuits on first match