matchCriticalBashCommand function

String? matchCriticalBashCommand(
  1. String command
)

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;
}