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 tutorial 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
deflink(uri, label=None, parameters=''):
''' Found in https://gist.github.com/egmontkob/eb114294efbcd5adb1944c9f3cb5feda , windows console and many unix consoles trick to embeed hyperlinks/uri with text '''iflabelisNone:
label=uri# OSC 8 ; params ; URI ST <name> OSC 8 ;; STescape_mask='\033]8;{};{}\033\\{}\033]8;;\033\\'returnescape_mask.format(parameters, uri, label)
importtyperfromtypingimportOptional, Listdeftest(address: Optional[str] =typer.Option('http://localhost.com', metavar='URL', help=f'URL of {link("https://localhost.com/bigurl-toobiggggggggggggggggg", "the biggest url you have ever seen ever")}.')):
passif__name__=="__main__":
typer.run(test)
#run as 'python3 -m test --help'
Description
I was wondering it it would be possible to make the print facility of typer when --help is invoked to ignore the length and not break on the middle, of escape sequences so that tricks like the above (placing a url link in the help output of a command for a option) will work.
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
I was wondering it it would be possible to make the print facility of typer when --help is invoked to ignore the length and not break on the middle, of escape sequences so that tricks like the above (placing a url link in the help output of a command for a option) will work.
Operating System
Linux
Operating System Details
No response
Typer Version
0.5.0
Python Version
Python 3.10.6
Additional Context
No response
Beta Was this translation helpful? Give feedback.
All reactions