-
Notifications
You must be signed in to change notification settings - Fork 1.4k
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
NPM js-beautify: different treatment of "-" in command line #390
Comments
Yikes. I don't use the |
I don't use it much either, but there was a confused user in comments for #27 who couldn't find how to use the reading from stdin, and I was surprised that my quick "js-beautify -" verification in the terminal failed. |
@einars, is it possible that you are using an older version of {
"argv": {
"remain": [],
"cooked": [],
"original": [
"-"
]
}
} while v2.1.2 returns {
"argv": {
"remain": [
"-"
],
"cooked": [
"-"
],
"original": [
"-"
]
}
} which causes execution to enter the loop at js/lib/cli.js:389. +1 for supporting |
We're now up to nopt v3.0.1. 😄 |
From npm, the command does not seem to handle stdin.
|
@cdosborn - Thanks!
There's a pull request already in for improving this area, so maybe this will get into the next release. |
Thanks, looking forward. |
This looks to be fixed for the next version. |
Is it possible that "-" as a parameter is being treated differently in the situation if the script is run from the git checkout, or from npm install?
js-beautify@1.4.2 installed via npm:
% js-beautify -
Unable to open path "/home/e/-"
git checkout, v1.4.2:
% ./js/bin/js-beautify.js -
[waiting for stdin]
The text was updated successfully, but these errors were encountered: