brentyi / tyro

CLI interfaces & config objects, from types
https://brentyi.github.io/tyro
MIT License
514 stars 27 forks source link

Better error message on incorrect argument #62

Closed vwxyzjn closed 1 year ago

vwxyzjn commented 1 year ago

When using hyperstate, something that I found helpful was its error message. Is there any chance tyro can support something similar? The relevant code is here: https://github.com/cswinter/hyperstate/blob/94b1ed31210afed8a9f60ca2a38d73ed7a7a5ea7/hyperstate/command.py#L17-L59

image

brentyi commented 1 year ago

Yeah, this looks nice!

Including help messages for fields that are passed invalid types seems useful, as does pointing out similar fields if we're given one that doesn't exist. Is there anything I'm missing?

I was also totally unaware of hyperstate; it looks clean.

vwxyzjn commented 1 year ago

:) Yeah current message looks like this, which can be overwhelming.

image
brentyi commented 1 year ago

Newest release should improve things on this front!