find static method

ICommand find(
  1. List<String> arguments
)

Implementation

static ICommand find(List<String> arguments) {
  if (arguments.isEmpty) throw NotFountCommand();
  String currentArgument = arguments.reduce((value, element) => '$value $element');
  return commandList.firstWhere(
    (command) => command.command == currentArgument,
    orElse: () => throw NotFountCommand(),
  );
}