1
0
mirror of https://github.com/Rikj000/MoniGoMani.git synced 2022-03-06 00:08:05 +03:00

🐞 MoniGoManiCli - Fixed parse_command() without properties

This commit is contained in:
Rikj000
2022-01-17 12:45:19 +01:00
parent fdbb52657f
commit e8b0d6dd63

View File

@@ -384,11 +384,16 @@ class MoniGoManiCli(object):
command = command[command.index(' ') + 1:]
# Parse & save the actual command
if ' ' not in command:
# Return command object if no properties are found
command_object['command'] = command
return command_object
command_object['command'] = command[:command.index(' ')]
command = command[command.index(' ') + 1:]
# Parse all properties as individual strings
# Continue with parsing all properties as individual strings if they are found
command = command[command.index(' ') + 1:]
command = command.replace('--', '-')
if command.startswith('-'):
command = command[1:]
properties = command.split(' -')