8000 Fix --help on subcommands by rytilahti · Pull Request #886 · python-kasa/python-kasa · GitHub
[go: up one dir, main page]

Skip to content

Fix --help on subcommands #886

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

Merged
merged 1 commit into from
Apr 30, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions kasa/cli.py
Original file line number Diff line number Diff line change
Expand Up @@ -306,9 +306,9 @@ async def cli(
):
"""A tool for controlling TP-Link smart home devices.""" # noqa
# no need to perform any checks if we are just displaying the help
if sys.argv[-1] == "--help":
if "--help" in sys.argv:
# Context object is required to avoid crashing on sub-groups
ctx.obj = Device(None)
ctx.obj = object()
return

# If JSON output is requested, disable echo
Expand Down
0