Fix alias handling
This commit is contained in:
parent
f5d2c48bbb
commit
22f096088b
@ -106,11 +106,15 @@ class CommandRunner(QObject):
|
|||||||
The new command string if an alias was found. Default value
|
The new command string if an alias was found. Default value
|
||||||
otherwise.
|
otherwise.
|
||||||
"""
|
"""
|
||||||
|
if config.val.aliases is None:
|
||||||
|
return default
|
||||||
|
|
||||||
parts = text.strip().split(maxsplit=1)
|
parts = text.strip().split(maxsplit=1)
|
||||||
try:
|
try:
|
||||||
alias = config.val.aliases[parts[0]]
|
alias = config.val.aliases[parts[0]]
|
||||||
except KeyError:
|
except KeyError:
|
||||||
return default
|
return default
|
||||||
|
|
||||||
try:
|
try:
|
||||||
new_cmd = '{} {}'.format(alias, parts[1])
|
new_cmd = '{} {}'.format(alias, parts[1])
|
||||||
except IndexError:
|
except IndexError:
|
||||||
|
Loading…
Reference in New Issue
Block a user