mirror of
https://github.com/libratbag/libratbag.git
synced 2026-11-07 23:23:52 +01:00
tools: ratbagctl.devel: fix exception if the given arguments are wrong
"sudo ./build/ratbagctl.devel profile 2 4" returns an exception with cmd being unknown. Signed-off-by: Benjamin Tissoires <benjamin.tissoires@gmail.com>
This commit is contained in:
committed by
Peter Hutterer
parent
87ecd6e252
commit
b2d29a0285
@@ -45,6 +45,8 @@ def main(argv):
|
||||
parser.want_keepalive = True
|
||||
print('export RATBAGCTL_DEVEL="{}"\n'.format(os.environ['RATBAGCTL_DEVEL']))
|
||||
|
||||
cmd = None
|
||||
|
||||
try:
|
||||
cmd = parser.parse(argv)
|
||||
cmd.func(ratbagd, cmd)
|
||||
@@ -54,6 +56,8 @@ def main(argv):
|
||||
signal.pause()
|
||||
except KeyboardInterrupt:
|
||||
pass
|
||||
except AttributeError: # in case the parsing failed and cmd is None
|
||||
pass
|
||||
toolbox.terminate_ratbagd(ratbagd_process)
|
||||
|
||||
|
||||
|
||||
Reference in New Issue
Block a user