Click Command with Options

Descripción

Create a Click command with options


File Template: ✅


Prefix

click:options


Scopes

python


Snippet de código

import click

@click.command()
@click.option('--count', default=1, help='Number of greetings.')
@click.option('--name', prompt='Your name', help='The person to greet.')
def ${1:greet}(count, name):
	"""${2:Send greetings to a person}"""
	for _ in range(count):
		click.echo(f'Hello {name}!')

if __name__ == '__main__':
	${1:greet}()