exclude method

ShellCommandsMap exclude({
  1. required String command,
  2. required SystemShell systemShell,
})

Returns a new ShellCommandsMap with the given command removed from systemShell.

Implementation

ShellCommandsMap exclude({
  required String command,
  required SystemShell systemShell,
}) {
  final modifiable = _modifiable();

  if (modifiable.containsKey(systemShell)) {
    modifiable[systemShell]!.remove(command);
  }

  return UnmodifiableMapView(
    modifiable.map((key, value) => MapEntry(key, UnmodifiableSetView(value))),
  );
}