Compare commits
2
Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
fd56f8ca63 | ||
|
|
77fabf28f6 |
@@ -3,6 +3,7 @@
|
||||
|
||||
from abc import ABC
|
||||
from re import match
|
||||
from shlex import split
|
||||
|
||||
from tfw.config.logs import logging
|
||||
|
||||
@@ -57,10 +58,10 @@ class TerminalCommands(ABC):
|
||||
return match(self._command_method_regex, string)
|
||||
|
||||
def callback(self, history):
|
||||
parts = history[-1].split()
|
||||
parts = split(history[-1])
|
||||
command = parts[0]
|
||||
if command in self.command_implemetations.keys():
|
||||
try:
|
||||
self.command_implemetations[command](*parts[1:])
|
||||
except IndexError:
|
||||
LOG.debug('Command "%s" failed!', command)
|
||||
except Exception: # pylint: disable=broad-except
|
||||
LOG.exception('Command "%s" failed:', command)
|
||||
|
||||
Reference in New Issue
Block a user