setting a default value for a global option overrides the context object.
yargs()
.command('batman', 'batman command', function (yargs) {
yargs.command('robin', 'robin command', {}, function (_argv) {
argv = _argv
})
})
.option('state', {
default: undefined,
global: true
})
.parse('batman robin --what', {
state: 'grumpy but rich'
}, function (_err, argv, _output) {})