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
I have a script that I'd like to collect the args at the end of the command as under a key, and still get type safety. Currently this isn't possible, as yargs.positional doesn't allow array as a type. Here's what I've had to resort to:
This does function, however, it requires me to do extra work by overriding the generic type for .command. Ideally, the builder would determine the type, which allowing positional to take type array would solve this. I'm not sure if there's a reason this isn't allowed, other than an array positional anywhere other than the end of the command doesn't make sense.
The text was updated successfully, but these errors were encountered:
I have a script that I'd like to collect the args at the end of the command as under a key, and still get type safety. Currently this isn't possible, as
yargs.positional
doesn't allow array as a type. Here's what I've had to resort to:This does function, however, it requires me to do extra work by overriding the generic type for
.command
. Ideally, the builder would determine the type, which allowing positional to take type array would solve this. I'm not sure if there's a reason this isn't allowed, other than an array positional anywhere other than the end of the command doesn't make sense.The text was updated successfully, but these errors were encountered: