Skip to content

Instantly share code, notes, and snippets.

@wd
Last active April 14, 2020 05:08
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save wd/149df8c79aaa1b734936c2e9108b3659 to your computer and use it in GitHub Desktop.
Save wd/149df8c79aaa1b734936c2e9108b3659 to your computer and use it in GitHub Desktop.
Could you find where is the bug?
from collections import defaultdict
import click
@click.group()
@click.pass_context
def cli(ctx):
print('cli init')
@cli.group()
@click.pass_context
def debian(ctx):
print('in debian')
@debian.command()
def list():
print('list')
cc = defaultdict(list)
cc[0]
cli()
# $ python test.py debian list
# cli init
# in debian
# list
# Usage: test.py [OPTIONS]
# Try 'test.py --help' for help.
#
# Error: Got unexpected extra arguments (debian list)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment