Improved error handling

This commit is contained in:
Sven Heidemann 2020-12-19 14:17:50 +01:00
parent d49aa30cb7
commit ceec896718

View File

@ -16,6 +16,11 @@ class Interpreter:
def interpret(self, input_string: str): def interpret(self, input_string: str):
input_list = input_string.split(' ') input_list = input_string.split(' ')
command = input_list[0] command = input_list[0]
if command is None or command == '':
Console.error(f'Expected command')
Console.error('Run \'cpl help\'')
return
args = input_list[1:] if len(input_list) > 1 else [] args = input_list[1:] if len(input_list) > 1 else []
cmd = next( cmd = next(