public function getCommandByIdentifier($commandIdentifier)
{
$commandIdentifier = strtolower(trim($commandIdentifier));
if ($commandIdentifier === 'help') {
$commandIdentifier = 'neos.flow:help:help';
}
if ($commandIdentifier === 'sys') {
$commandIdentifier = 'neos.flow:cache:sys';
}
$matchedCommands = $this->getCommandsByIdentifier($commandIdentifier);
if (count($matchedCommands) === 0) {
throw new NoSuchCommandException('No command could be found that matches the command identifier "' . $commandIdentifier . '".', 1310556663);
}
if (count($matchedCommands) > 1) {
throw new AmbiguousCommandIdentifierException('More than one command matches the command identifier "' . $commandIdentifier . '"', 1310557169, null, $matchedCommands);
}
return current($matchedCommands);
}