Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Improve help for types that have choices #55

Open
multimeric opened this issue Sep 12, 2023 · 0 comments
Open

Improve help for types that have choices #55

multimeric opened this issue Sep 12, 2023 · 0 comments

Comments

@multimeric
Copy link

For example, if you have a Pydantic model with an enum type, the flag will be displayed as:

  --skew SKEW           (type:DeskewDirection default:DeskewDirection.Y)

Similarly, if you use a Literal:

class Model(BaseModel):
    bar: Literal["x", "y"]

you get:

  --bar BAR             (type:typing.Literal['x', 'y'] required=True)

In all of these cases, we have a readily accessible list of options, and it would be much more user friendly to provide these in the help.

Compare this to argparse's choices, which are printed as:

usage: game.py [-h] {rock,paper,scissors}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant