ICommandDefinition ResolveCommand(string argument) { if (!CommandDefinition.CanBeCommand(argument)) { return(null); } IEnumerable <ICommandDefinition> commands = definition.GetRegisteredCommands(); return(commands.FirstOrDefault(c => c.IsMatch(argument))); }