You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Perhaps my expectations are misplaced, but I find the current .version() API to be very confusing. Based on the docs:
.VERSION([OPTION], [DESCRIPTION], [VERSION])
I would expect to be able to do this:
varargv=require('yargs').version('V').argv
$ node test-version.js -V
1.0.0 # or whatever version is in package.json
But instead the first argument is treated as the version value and I cannot override the --version option:
$ node test-version.js --version
V
At the very least, we should clarify the expected behavior in the docs.
At the worst, this confuses and frustrates users, seeming to undo the work done in #330 (meant to address #329) that was supposed to make the API more consistent with, e.g., .help('H').
We also have no tests for the version method accepting a single argument, but based on this comment I thought my expectations of .version('V') were correct - so I could not validate them based on documentation or tests.
Which is perfectly acceptable, but I just find the API confusing, and it would be nice to be able to completely override --version without having to do the package.json lookup manually.
The text was updated successfully, but these errors were encountered:
Perhaps my expectations are misplaced, but I find the current
.version()
API to be very confusing. Based on the docs:I would expect to be able to do this:
$ node test-version.js -V 1.0.0 # or whatever version is in package.json
But instead the first argument is treated as the version value and I cannot override the
--version
option:At the very least, we should clarify the expected behavior in the docs.
At the worst, this confuses and frustrates users, seeming to undo the work done in #330 (meant to address #329) that was supposed to make the API more consistent with, e.g.,
.help('H')
.We also have no tests for the version method accepting a single argument, but based on this comment I thought my expectations of
.version('V')
were correct - so I could not validate them based on documentation or tests.The best I can seem to do is:
Which is perfectly acceptable, but I just find the API confusing, and it would be nice to be able to completely override
--version
without having to do the package.json lookup manually.The text was updated successfully, but these errors were encountered: