matchCriticalBashCommand function
Returns the label of the first criticalBashPatterns entry matching
command, or null when the command matches nothing critical.
Implementation
String? matchCriticalBashCommand(String command) {
final normalized = command.trim();
if (normalized.isEmpty) return null;
for (final entry in criticalBashPatterns) {
if (entry.matches(normalized)) return entry.label;
}
return null;
}