Skip to content

Commit

Permalink
miiocli: Handle unknown commands (Closes: #327) (#329)
Browse files Browse the repository at this point in the history
  • Loading branch information
syssi authored Jun 2, 2018
1 parent a639b12 commit af2417a
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 af2417a

Please sign in to comment.