Last active
March 14, 2022 20:23
-
-
Save lewoudar/a868d4b7d323904aa444fc69c76d308b to your computer and use it in GitHub Desktop.
Example of click_param list parameter
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import click | |
from click_params import StringListParamType | |
@click.option( | |
'-f', '--flavors', | |
prompt=True, | |
help='list of flavors for your ice cream', | |
type=StringListParamType() | |
) | |
@click.command() | |
def cli(flavors): | |
"""Prepare an ice cream with the given list of flavors""" | |
for flavor in flavors: | |
click.echo(f'- {flavor}') |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment