-
Notifications
You must be signed in to change notification settings - Fork 29.7k
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
Filenames / dirnames with a leading hyphen: a CLI argument issue #10661
Comments
The only way to do this would be to introduce a new option like So CLI usage now becomes The code change wouldn't be trivial in my estimation so probably better to open a separate PR. |
I'd rather not introduce a new command line flag for this, especially given that there are ways of working around it already. |
Why wouldn’t |
Do you mean |
@jBarz exactly. ;) The solution in your PR seems tailored for |
Yes, that would work ! My reason for using "--" in #10651 comes from the POSIX.2 standard
So using the "--" for any other purpose would deviate from other unix tools, I think. |
@jBarz Okay, would you want to update the PR with this then? :) It looks to me like you’d just need to drop the |
I do not think that |
I mean… it’s pretty standard to support it that way? |
I think that conflicts with the potential use in #10651 though? |
@jBarz I don't understand why the Traditional UNIX usage, which is what is usually specified by POSIX, is that getopt() and similar stop treating The What is the distinction you are drawing? |
Ahh, I initially understood operands to be just the args passed into the script. i.e. But I believe what you are saying is that the operands include the script name. i.e. |
I could be missing a corner case, and the distinction between node and v8, but above is my understanding. |
This can be closed. |
Yup, this should work fine now. :) |
I don't know if this is a deprecated style in *nix to start filenames with a hyphen, but in Windows, it seems there are no shell problems with it:
dir -test
ortype -test.txt
are OK. However, Node.js confuses these names with arguments:If this is a wontfix, maybe it worth to be documented in the 'Command Line Options' doc.
The text was updated successfully, but these errors were encountered: