Open GearsDatapacks opened 1 week ago
Yeah this definitely on my todo list. I'm still not settled on an API, though it's probably pretty close to where it will end up. I want to get that locked down before working on anything else.
The current implementation for encoding is pretty limited in scope and will get rewritten. Right now, all positional information is lost as the args are encoded as a dictionary. Positional arguments aren't really possible before a rewrite.
You can also give clip a try. It has more features and seems to have more momentum behind it at the moment. It's goals do not entirely align with mine for clad. A main goal for clad is to feel the same as writing a normal decoder. I'm currently hedging my bets that toy will "win", and something similar will be added to the standard lib, so I'm trying to align with it.
For example:
This would parse
program <name> <age> [-a|--alive]
Default positional arguments don't make much sense, because if you omit one, the whole chain breaks.