We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
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
Save this snippet as example.js
example.js
var argv = require('yargs-parser')(process.argv.slice(2)) console.log(argv)
If we run the file by passing these arguments, then we are getting expected result of both arguments i.e foo as 33 and bar as hello
$ node example.js --foo=33 --bar "hello" { _: [], foo: 33, bar: 'hello' }
But, if we pass bar argument value whose starting character is -, then output changes a lot, and it's also not a expected one
bar
$ node example.js --foo=33 --bar "-hello" { _: [], foo: 33, bar: true, h: true, e: true, l: [ true, true ], o: true }
Here, foo argument has correct value but bar argument value is now boolean.
{ _: [], foo: 33, bar: 'hello' }
The text was updated successfully, but these errors were encountered:
closing in favor of #145, please feel free to join the conversation there.
Sorry, something went wrong.
No branches or pull requests
Steps to reproduce
Save this snippet as
example.js
If we run the file by passing these arguments, then we are getting expected result of both arguments i.e foo as 33 and bar as hello
But, if we pass
bar
argument value whose starting character is -, then output changes a lot, and it's also not a expected oneHere, foo argument has correct value but bar argument value is now boolean.
Expected output in both instructions
The text was updated successfully, but these errors were encountered: