-
Notifications
You must be signed in to change notification settings - Fork 1k
Closed
Description
I have this command definition:
module.exports = {
command: 'ls [options]',
describe: 'List tags',
builder(yargs) {
yargs
.option('task', {
alias: 't',
describe: 'a task number',
type: 'string',
requiresArg: true
})
.coerce('task', arg => {
console.log('AAA: ', arg)
return arg
})
.showHelpOnFail(true)
},
async handler(argv) {
...
}
}But when option --task is not provided, the coerce function is not called. Is it really the expected behaviour? Shouldn't the function be called with undefined nonetheless?
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
No labels