-
Notifications
You must be signed in to change notification settings - Fork 0
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
Cannot use wildcard to test multiple files at once on Windows #2
Comments
I'm afraid I'm quite unfamiliar with the Windows command line (been on Linux for the past 15 or even 20 years). Apparently, unlike Unix shells, the Windows shell * does not expand the wildcard before passing the arguments to the command. So that modish gets the string I cannot test right now, but maybe something like the following works in Powershell?
(Of course, note that for that specific example one can simply run I will have to decide whether modish should expand wildcards itself when it gets strings that do not match existing files. Not so sure what the best course of action is. |
Oh, and I changed the title of this issue because |
Yes, that works as expected. |
Apparently, there a multiple javascript packages that take care of wildcard patterns, e.g. glob |
We would not even have to depend on an external package, but could use What I am unsure about is when we should expand the input:
|
What speaks against doing this always? Any possible drawbacks?
|
Well, it is perfectly valid for a filename in Unix to include wildcard characters such as Expanding in every case would thus introduce bugs for people on Linux or MacOS. (Note: naming a file |
Ok, I see. The glob package claims to behave just like the shell would. It shouldn't make a difference whether the shell expands the wildcards or if expansion is done during processing. Is it possible to check whether the argument is quoted? |
Note to self: this is a common problem (see e.g. pallets/click#1096 and BurntSushi/ripgrep#234). Easiest way is probably to do it the way Click does it, i.e. always expand on Windows systems. I will implement the fix soon. |
Hi,
testing multiple files at once does not work as expected on Windows (tested on powershell and cmd):
Using git bash the above syntax works perfectly. Don't know if this is an issue with powershell and cmd, or if this related to modish, or a combination of both...
The text was updated successfully, but these errors were encountered: