You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
There should be an option to make the choices be "optional" rather than throw an error. If it doesn't find a match it should consider the rest of the arguments to be positional arguments. This can be especially useful for arrays as shown in above example. It should throw (in case of an array) only if the first argument doesn't match.
With commands we're more explicit, where only the last positional argument can be veridadic, so you can do this:
[item] [item2...]
but but:
[item...] [item2...]
☝️ in general, I think this is a better approach for handling variable length input, and I'm not a huge fan of the array argument type.
I'd rather that folks are more explicit and specify --item 1 --item 2, rather than --item 1 2; I'm wondering if perhaps we could deprecate the variable --item 1 2 3 array parsing, in favor of this; CC: @juergba.
I have a config like this:
So this works:
But this throws an error:
There should be an option to make the choices be "optional" rather than throw an error. If it doesn't find a match it should consider the rest of the arguments to be positional arguments. This can be especially useful for arrays as shown in above example. It should throw (in case of an array) only if the first argument doesn't match.
This could possibly address #219
The text was updated successfully, but these errors were encountered: