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
This would be nice, I agree. It's not currently possible. I haven't done it yet because I don't know the best way to do it.
For instance, the Nim proc that changes a string to an int is parseInt, so should the argument use type=parseInt? If so, it'll have to figure out how to extract the return type of that function so that the opts object has the right type.
Another option would be to require people to pass both type=int and validator=parseInt. That would be easier for argparse but maybe not as nice for users?
First of all: Great project! Finally writing CLIs will become convenient in Nim ;).
I was wondering if it is possible to have type converters / custom validators similar to Python/argparse's
type
that can be used for use cases like:float
.It would be nice if these use cases would not require a manual post-parsers validation + convert. Is that already possible?
The text was updated successfully, but these errors were encountered: