-
Notifications
You must be signed in to change notification settings - Fork 1k
Open
Description
Given the following option on a command:
.option('my-option', {
type: 'array',
desc: "my-desc",
})When my-option is not provided via the arguments, command['my-option'] is undefined, as expected.
But when I specify the option this way:
.option('my-option', {
default: undefined,
type: 'array',
desc: "my-desc",
})I expect the default value for my-option to be undefined. However I see that the default value becomes [undefined]. This feels out of the ordinary and causes downstream issues when I try to ensure that my-option is undefined.
I would like yargs to respect my provided default and not throw it into an array.
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
No labels