You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I used the GitHub search to find a similar question and didn't find it.
I searched the Typer documentation, with the integrated search.
I already searched in Google "How to X in Typer" and didn't find any information.
I already read and followed all the tutorials in the docs and didn't find an answer.
I already checked if it is not related to Typer but to Click.
Commit to Help
I commit to help with one of those options 👆
Example Code
fromtypingimportAnnotatedimporttyperapp=typer.Typer()
@app.command()defexample(
a: Annotated[str, typer.Option(help="This is A")],
b: Annotated[str, typer.Option(help=f"This is {typer.style('B', underline=True)}")],
):
passif__name__=="__main__":
app()
Description
When using typer.style in the help text of a command option, the rightmost | in the "frame" of the Options output is misaligned. This seems to be due to a miscalculation of the help line length, caused by the invisible style characters.
Using the example script - run python example.py --help and you should get this output:
(highlighted the misaligned part)
reacted with thumbs up emoji reacted with thumbs down emoji reacted with laugh emoji reacted with hooray emoji reacted with confused emoji reacted with heart emoji reacted with rocket emoji reacted with eyes emoji
-
First Check
Commit to Help
Example Code
Description
When using
typer.style
in the help text of a command option, the rightmost|
in the "frame" of the Options output is misaligned. This seems to be due to a miscalculation of the help line length, caused by the invisible style characters.Using the example script - run
python example.py --help
and you should get this output:(highlighted the misaligned part)
Operating System
macOS
Operating System Details
macOS version: 13.7.1 (22H221)
Typer Version
0.15.1
Python Version
3.10.13
Additional Context
No response
Beta Was this translation helpful? Give feedback.
All reactions