Skip to content

Commit

Permalink
Fix auto-completion of choices (#2295)
Browse files Browse the repository at this point in the history
Avoids pallets/click#591 by converting choices
to lists of strings.

Signed-off-by: Sorin Sbarnea <[email protected]>
  • Loading branch information
ssbarnea authored Sep 15, 2019
1 parent 5bc7350 commit 5c41a37
Show file tree
Hide file tree
Showing 6 changed files with 7 additions and 7 deletions.
2 changes: 1 addition & 1 deletion molecule/command/create.py
Original file line number Diff line number Diff line change
Expand Up @@ -105,7 +105,7 @@ def execute(self):
@click.option(
'--driver-name',
'-d',
type=click.Choice(drivers()),
type=click.Choice([str(s) for s in drivers()]),
help='Name of driver to use. (docker)',
)
def create(ctx, scenario_name, driver_name): # pragma: no cover
Expand Down
2 changes: 1 addition & 1 deletion molecule/command/destroy.py
Original file line number Diff line number Diff line change
Expand Up @@ -118,7 +118,7 @@ def execute(self):
@click.option(
'--driver-name',
'-d',
type=click.Choice(drivers()),
type=click.Choice([str(s) for s in drivers()]),
help='Name of driver to use. (docker)',
)
@click.option(
Expand Down
4 changes: 2 additions & 2 deletions molecule/command/init/role.py
Original file line number Diff line number Diff line change
Expand Up @@ -105,7 +105,7 @@ def execute(self):
@click.option(
'--driver-name',
'-d',
type=click.Choice(api.drivers()),
type=click.Choice([str(s) for s in api.drivers()]),
default='docker',
help='Name of driver to initialize. (docker)',
)
Expand All @@ -124,7 +124,7 @@ def execute(self):
@click.option('--role-name', '-r', required=True, help='Name of the role to create.')
@click.option(
'--verifier-name',
type=click.Choice(api.verifiers()),
type=click.Choice([str(s) for s in api.verifiers()]),
default='testinfra',
help='Name of verifier to initialize. (testinfra)',
)
Expand Down
2 changes: 1 addition & 1 deletion molecule/command/init/scenario.py
Original file line number Diff line number Diff line change
Expand Up @@ -188,7 +188,7 @@ def _default_scenario_exists(ctx, param, value): # pragma: no cover
)
@click.option(
'--verifier-name',
type=click.Choice(api.verifiers()),
type=click.Choice([str(s) for s in api.verifiers()]),
default='testinfra',
help='Name of verifier to initialize. (testinfra)',
)
Expand Down
2 changes: 1 addition & 1 deletion molecule/command/prepare.py
Original file line number Diff line number Diff line change
Expand Up @@ -115,7 +115,7 @@ def execute(self):
@click.option(
'--driver-name',
'-d',
type=click.Choice(drivers()),
type=click.Choice([str(s) for s in drivers()]),
help='Name of driver to use. (docker)',
)
@click.option(
Expand Down
2 changes: 1 addition & 1 deletion molecule/command/test.py
Original file line number Diff line number Diff line change
Expand Up @@ -104,7 +104,7 @@ def execute(self):
@click.option(
'--driver-name',
'-d',
type=click.Choice(drivers()),
type=click.Choice([str(s) for s in drivers()]),
help='Name of driver to use. (docker)',
)
@click.option(
Expand Down

0 comments on commit 5c41a37

Please sign in to comment.