Slide 19
Slide 19 text
— Python
50 nuances de CLI
01
## Click
@click.command
()
@click.option('--count', default=1, help='Number of greetings.'
)
@click.option('--name', prompt='Your name', help='The person to greet.'
)
def hello(count, name):
## Typer
def main(
name: str,
lastname: str=typer.Option(
"", help="Last name ..."),
formal: bool=typer.Option(
False, help="Say hi formally."
),
):
if __name__ == "__main__":
typer.run(main)
Libraries
- Click
- Typer
Fonctionnalités
- Completion
- Sous commandes
- Gestion d’erreur
- Aide
- …