typed-argparse / typed-argparse

💡 write type-safe and elegant CLIs with a clear separation of concerns.
https://typed-argparse.github.io/typed-argparse/
MIT License
28 stars 6 forks source link

PoC: allow the user to customize how to generate flags. #53

Open mikolajz opened 1 year ago

bluenote10 commented 1 year ago

In its current form, the arg(generator=bool_with_no_arg) slightly conflicts with a few other plans I had in mind: Since the @overloads of the arg basically have an "exponential explosion" issue (basically every new feature switch requires to double the number of overloads), I'm considering to switch to more specific argument annotations, i.e., possibly different ones for plain T, nargs T, boolean switches, and perhaps also splitting it up for positional vs non-positional ones. After that change, having such special kind of boolean switches, and even fully custom / user-defined argument types would be much easier to support. I hope I can find some more time to really think this through (sorry for the delays in general -- just not finding enough time on this recently)!