lukeed / sade

Smooth (CLI) Operator 🎶

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

What about required thing for some option? Possible?

tunnckoCore opened this issue · comments

Didn't even tried, but it's not documented anyway, so this issue could be used for such PR.

I'm talking about somehting like

mycli cmd --registry <url> --token=<authToken>

In above, <url> is required for the registry option so it should throw with "Insufficient arguments for that option" or something like that. To be the same as when there is required args for some command.

As i looked over the source code before some days, i didn't noticed that it is possible, because of the simple parsing in $.parse utility, so.

Sade only enforces required values for positional arguments, not option flags.

This is user-land code, and opts.lazy makes this easy to do.