Improved error handling
This commit is contained in:
parent
d49aa30cb7
commit
ceec896718
@ -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(
|
||||||
|
Loading…
Reference in New Issue
Block a user