20 lines
397 B
Python
20 lines
397 B
Python
import click
|
|
|
|
|
|
@click.command()
|
|
@click.option('-c',
|
|
'--count',
|
|
default=1,
|
|
help='Number of greetings.')
|
|
@click.option('-n',
|
|
'--name',
|
|
prompt='Your name',
|
|
help='The person to greet.')
|
|
def hello(count, name):
|
|
for x in range(count):
|
|
click.echo('Hello %s!' % name)
|
|
|
|
|
|
if __name__ == '__main__':
|
|
hello()
|