-
First Check
Commit to Help
Example Codeimport typer
from typing_extensions import Annotated
app = typer.Typer(rich_markup_mode="rich")
@app.command()
def hello(
name: Annotated[
str, typer.Option(help="The [bold]cool[/bold] name of the [green]user[/green]")
],
):
"""
Say [bold]hi[/bold] to the user.
"""
print(f"Hello {name}")
@app.command()
def goodbye(
name: Annotated[
str, typer.Option(help="The [bold]cool[/bold] name of the [green]user[/green]")
],
):
"""
Say [bold]goodbye[/bold] to the user.
"""
print(f"Goodbye {name}")
if __name__ == "__main__":
app() Description
But their Zsh help string includes the Rich markup content:
It should show plaintext without Operating SystemLinux, macOS Operating System DetailsThis applies mainly to Zsh, the behavior might be similar or different in PowerShell. It only applies in shells that can show autocompletion of commands with help sections. Typer VersionTyper version: 0.12.3 Python Versionany Additional ContextNo response |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment
-
I submitted a PR #877 that at least should adress removing the tags from the output. If anyone wants to test the PR, I'd appreciate it! Just let me know which OS and shell you're on, and fill in the following boxes for your system:
A simple script you can use to double check whether your console supports Rich formatting, is the following:
|
Beta Was this translation helpful? Give feedback.
I submitted a PR #877 that at least should adress removing the tags from the output.
If anyone wants to test the PR, I'd appreciate it! Just let me know which OS and shell you're on, and fill in the following boxes for your system:
master
A simple script you can use to double check whether your console supports Rich formatting, is the following: