Optique 0.7.0 will support Zod schemas as value parsers.
Seemed like a natural fit—same validation logic for both CLI and app code.
Optique 0.7.0 will support Zod schemas as value parsers.
Seemed like a natural fit—same validation logic for both CLI and app code.
Update: Just added automatic metavar inference!
The help text now gets smarter labels based on your Zod schema:
z.string().email() → EMAILz.coerce.number().int() → INTEGERz.enum([…]) → CHOICENo manual configuration needed.
https://github.com/dahlia/optique/commit/d4903dfdb88727a488dedb6a73ad8997868246e1
If you have a fediverse account, you can quote this note from your own instance. Search https://hollo.social/@hongminhee/019a99b7-4a13-75b4-b83f-c86a3bb68d25 on your instance and quote it. (Note that quoting is not supported in Mastodon.)