arcanis / clipanion

Type-safe CLI library / framework with no runtime dependencies
https://mael.dev/clipanion/
1.12k stars 66 forks source link

feat: required options #68

Closed paul-soporan closed 3 years ago

paul-soporan commented 3 years ago

Options can now also be required, which will cause an UnknownSyntaxError to be thrown if one of the required options is missing. It also allows commands to be disambiguated by their required options (see the tests).

paul-soporan commented 3 years ago

I've also added better arity support in the typings (now the tuple length will be inferred from the arity option). The order of the overloads is intended, don't change it or everything will break.