diff --git a/docs/tutorial/typer-command.md b/docs/tutorial/typer-command.md index 20dcb7546a..710115a749 100644 --- a/docs/tutorial/typer-command.md +++ b/docs/tutorial/typer-command.md @@ -242,73 +242,7 @@ You can also use the `typer` command to generate Markdown documentation for your For example, you could have a script like: ```Python -import typer -from typing_extensions import Annotated - -app = typer.Typer(help="Awesome CLI user manager.") - - -@app.command() -def create(username: str): - """ - Create a new user with USERNAME. - """ - print(f"Creating user: {username}") - - -@app.command() -def delete( - username: str, - force: Annotated[ - bool, - typer.Option( - prompt="Are you sure you want to delete the user?", - help="Force deletion without confirmation.", - ), - ], -): - """ - Delete a user with USERNAME. - - If --force is not used, will ask for confirmation. - """ - if force: - print(f"Deleting user: {username}") - else: - print("Operation cancelled") - - -@app.command() -def delete_all( - force: Annotated[ - bool, - typer.Option( - prompt="Are you sure you want to delete ALL users?", - help="Force deletion without confirmation.", - ), - ], -): - """ - Delete ALL users in the database. - - If --force is not used, will ask for confirmation. - """ - if force: - print("Deleting all users") - else: - print("Operation cancelled") - - -@app.command() -def init(): - """ - Initialize the users database. - """ - print("Initializing user database") - - -if __name__ == "__main__": - app() +{!../docs_src/commands/help/tutorial001.py!} ``` ### Generate docs with the `typer` command