Compare commits

..
+4 -3
View File
@@ -3,6 +3,7 @@
from abc import ABC from abc import ABC
from re import match from re import match
from shlex import split
from tfw.config.logs import logging from tfw.config.logs import logging
@@ -57,10 +58,10 @@ class TerminalCommands(ABC):
return match(self._command_method_regex, string) return match(self._command_method_regex, string)
def callback(self, history): def callback(self, history):
parts = history[-1].split() parts = split(history[-1])
command = parts[0] command = parts[0]
if command in self.command_implemetations.keys(): if command in self.command_implemetations.keys():
try: try:
self.command_implemetations[command](*parts[1:]) self.command_implemetations[command](*parts[1:])
except IndexError: except Exception: # pylint: disable=broad-except
LOG.debug('Command "%s" failed!', command) LOG.exception('Command "%s" failed:', command)