Skip to main content

is_trackable_command

Function is_trackable_command 

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

True when a command may become a learned-rule command trigger.

Rejects empty/whitespace commands, compound commands (;, &&, ||, |, newline), commands whose leading word is a variable assignment (FOO=bar npm test keeps its assignment prefix out of learned triggers), and shell builtins/keywords/common utilities (GH-813). The leading word is taken quote-aware, so "echo" hi is also rejected.