-
Notifications
You must be signed in to change notification settings - Fork 995
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
default value interferes with passing context to sub-commands #724
Comments
@bcoe I think I tracked down the problem. It seems like var parsed = yargs.parse('--foo bar', {
foo: 'not bar'
})
parsed.foo.should.equal('not bar') If I'm not totally wrong here, it seems that the problem lies in L875, where
Edit: Never mind, finally got this 😄 I guess the problem is that when we merge argv and context, the default values are already in argv. |
@bcoe I would propose we add a new parameter for the parser like: |
setting a default value for a global option overrides the context object.
The text was updated successfully, but these errors were encountered: