Closed kontrafiktion closed 6 years ago
test code:
#!/usr/bin/env python
import click
import click_completion
click_completion.init(complete_options=True)
@click.group(help)
def completion():
"""Needed for click_completion."""
pass
@completion.command()
@click.option('--template', "template_key", type=click.Choice(["kotlin-rest-spring-boot-local", "kotlin-rest-spring-boot", "java-rest-spring-boot"]))
def create(template_key=None):
pass
if __name__ == '__main__':
create()
See the conversation in #14
I have a Choice option with the following values: "kotlin-rest-spring-boot-local", "kotlin-rest-spring-boot", "java-rest-spring-boot"
when I hit 'tab'for the first time at
I get
because '-rest-spring' is a common substring. Hitting 'tab' again, nothing happens because:
only checks for 'startswith'.
If I replace the above code with:
everything works fine