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
https://github.com/CrossNox/typer-argdash
Description
I have a poetry package with a Typer object as entrypoint. A subcommand has the following --help page:
poetry run typer_argdash -vv command first --help
Usage: typer_argdash command first [OPTIONS] A B
╭─ Arguments ─────────────────────────────────────────────────────────────────────────────────────╮
│ * a TEXT [default: None] [required] │
│ * b TEXT [default: None] [required] │
╰─────────────────────────────────────────────────────────────────────────────────────────────────╯
╭─ Options ───────────────────────────────────────────────────────────────────────────────────────╮
│ --c --no-c [default: no-c] │
│ --help Show this message and exit. │
╰─────────────────────────────────────────────────────────────────────────────────────────────────╯
I want to be able to pass -something as a. For instance:
poetry run typer_argdash -vv command first --no-c -1 '2'
But that raises this error:
poetry run typer_argdash -vv command first -1 2 --no-c
Usage: typer_argdash command first [OPTIONS] A B
Try 'typer_argdash command first --help' for help.
╭─ Error ───────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────╮
│ No such option: -1 │
╰────────────────
poetry run typer_argdash -vv command first --no-c -- -1 2
Usage: typer_argdash command first [OPTIONS] A B
Try 'typer_argdash command first --help' for help.
╭─ Error ───────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────╮
│ No such option: -1 │
╰───────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────╯
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 have a poetry package with a
Typer
object as entrypoint. A subcommand has the following--help
page:I want to be able to pass
-something
asa
. For instance:But that raises this error:
As per #134, this should do the trick:
But errors as well.
Is there any way to do this?
Operating System
Linux
Operating System Details
Fedora 38
Typer Version
0.12.3
Python Version
3.11
Additional Context
No response
Beta Was this translation helpful? Give feedback.
All reactions