-
-
Notifications
You must be signed in to change notification settings - Fork 2.2k
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
pref: fix regression of command flags not working #21647
Conversation
What happens if you have a How about In other words, if there's a directory with the same name as a command, it is limiting to force one over the other. |
Requires
Ending slash |
So force people to type the |
Yep. How else would you solve that? If you have a builtin v command and there is a directory with the same name? |
Ok, try this. Suppose I'd been working on a program named Then one day I do Suddenly my build script, my testing, etc., all fail to work any longer, because I would be very... unamused. |
Again, how else would you solve it? |
The regression might be more unamusing. |
It would have been better if V had required the As it is, no matter which way you do this, there can be problems. I think it might be nicer to the user to at least warn them of the ambiguity... perhaps tell them the alternatives. |
Something like an info message when there is a directory with the same name to target it with the |
Yes. There shouldn't be any surprises. It's ok if the command "wins", but it should also tell you about it instead of silently doing that. |
Would that be okay for a separate PR? This one would just fix the regression and keep the behavior as it was. I think we can agree on improving behavior when there is a file/dir with the same name as a command; it's just that this PR doesn't introduce a new issue. It was the way things were handled before the commands stopped working in the described way. |
I don't understand... wouldn't it be as simple as adding a notice before the If it's more involved than that, then yes, a separate PR would work... as long as it's not forgotten. |
Yes, adding it is that simple. Just felt that would be a separate change. |
Suggestions on the message are welcome @JalonSolov |
This reverts commit 9aadc25.
Reverting adding the print here as it impacts other tests. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It would need a test to prevent future regressions, but currently I can not see a good way to do it in a stable and portable way.
Good work.
…subfolder, named after the command, in the current working folder (vlang#21647)
Fixes a regression where it's not possible to run some V commands with flags anymore after #21391. For example, if there is directory with the same name as the command, like having a
fmt
directory in the in the cwd and trying to run v fmt -diff file.v.