Skip to content

Instantly share code, notes, and snippets.

@lewoudar
Last active March 14, 2022 20:23
Show Gist options
  • Save lewoudar/a868d4b7d323904aa444fc69c76d308b to your computer and use it in GitHub Desktop.
Save lewoudar/a868d4b7d323904aa444fc69c76d308b to your computer and use it in GitHub Desktop.
Example of click_param list parameter
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