Replies: 1 comment
-
|
I finally found the solution in the repo in tests/test_others.py app = typer.Typer(
...,
context_settings={"help_option_names": ["-h", "--help"]},
)I was not able to find it in the documentation. It seems that it is nowhere in the documentation. |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
-
First Check
Commit to Help
Example Code
Description
Many CLI tools support both --help and -h for displaying help. Currently, adding -h support in Typer requires significant boilerplate code (something like the example). I understand the current behavior is intentional, but it would be helpful to have a simpler opt-in mechanism.
The current solution is quite verbose for a common use case.
Something like this could be supported:
or ?
Operating System
Linux, Windows, macOS
Operating System Details
No response
Typer Version
0.20.0
Python Version
3.11
Additional Context
No response
Beta Was this translation helpful? Give feedback.
All reactions