def choose_license(licenses, author, year):
click.echo("Found the following matching licenses:")
click.echo(
green(
"\n".join(
[
'{index}: {name}'.format(index=index + 1, name=lic.name)
for index, lic in enumerate(licenses)
]
)
)
)
choice = click.prompt(
"Please choose which one you'd like to add",
default=1,
type=click.IntRange(1, len(licenses))
)
return licenses[choice - 1]
评论列表
文章目录