Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

miiocli: Provide an error message for unknown commands #327

Closed
syssi opened this issue Jun 2, 2018 · 0 comments
Closed

miiocli: Provide an error message for unknown commands #327

syssi opened this issue Jun 2, 2018 · 0 comments

Comments

@syssi
Copy link
Collaborator

syssi commented Jun 2, 2018

This should be handled more nicely:

miiocli powerstrip --ip 192.168.130.89 --token 8f7537427792e82610162df211814ba8 foo
Traceback (most recent call last):
  File "/usr/local/bin/miiocli", line 11, in <module>
    sys.exit(create_cli())
  File "/usr/local/lib/python3.5/dist-packages/miio/cli.py", line 43, in create_cli
    return cli(auto_envvar_prefix="MIIO")
  File "/usr/local/lib/python3.5/dist-packages/miio/click_common.py", line 53, in __call__
    return self.main(*args, **kwargs)
  File "/usr/local/lib/python3.5/dist-packages/click/core.py", line 697, in main
    rv = self.invoke(ctx)
  File "/usr/local/lib/python3.5/dist-packages/click/core.py", line 1066, in invoke
    return _process_result(sub_ctx.command.invoke(sub_ctx))
  File "/usr/local/lib/python3.5/dist-packages/click/core.py", line 1061, in invoke
    cmd_name, cmd, args = self.resolve_command(ctx, args)
  File "/usr/local/lib/python3.5/dist-packages/click/core.py", line 1100, in resolve_command
    cmd = self.get_command(ctx, cmd_name)
  File "/usr/local/lib/python3.5/dist-packages/miio/click_common.py", line 221, in get_command
    cmd = self.commands[cmd_name]
KeyError: 'foo'
syssi added a commit to syssi/python-miio that referenced this issue Jun 2, 2018
@syssi syssi closed this as completed in af2417a Jun 2, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant