Fix alias handling

This commit is contained in:
Florian Bruhin 2017-06-16 12:57:17 +02:00
parent f5d2c48bbb
commit 22f096088b

View File

@ -106,11 +106,15 @@ class CommandRunner(QObject):
The new command string if an alias was found. Default value
otherwise.
"""
if config.val.aliases is None:
return default
parts = text.strip().split(maxsplit=1)
try:
alias = config.val.aliases[parts[0]]
except KeyError:
return default
try:
new_cmd = '{} {}'.format(alias, parts[1])
except IndexError: