Skip to content

Commit

Permalink
miiocli: Handle unknown commands (Closes: #327)
Browse files Browse the repository at this point in the history
  • Loading branch information
syssi committed Jun 2, 2018
1 parent b5738af commit 6200e2d
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions miio/click_common.py
Original file line number Diff line number Diff line change
Expand Up @@ -218,6 +218,9 @@ def command_callback(self, command, device, *args, **kwargs):
return command.call(device, *args, **kwargs)

def get_command(self, ctx, cmd_name):
if cmd_name not in self.commands:
ctx.fail('Unknown command (%s)' % cmd_name)

cmd = self.commands[cmd_name]
return self.commands[cmd_name].wrap(ctx, self.device_pass(partial(
self.command_callback, cmd
Expand Down

0 comments on commit 6200e2d

Please sign in to comment.