Join GitHub today
GitHub is home to over 31 million developers working together to host and review code, manage projects, and build software together.
Sign upExpand glob paths on Windows #234
Comments
This comment has been minimized.
This comment has been minimized.
|
What do other command line tools like |
BurntSushi
added
the
question
label
Nov 13, 2016
This comment has been minimized.
This comment has been minimized.
|
But all native Windows tools I know do the expansion themselves, at least if it makes sense to expand. |
This comment has been minimized.
This comment has been minimized.
|
Usually you just use FindFirstFile/FindNextFile for this. |
This comment has been minimized.
This comment has been minimized.
|
sigh Indeed, it looks like globbing is done as part of the command line program: https://cygwin.com/ml/cygwin/2009-12/msg01097.html Other instances of the same problem:
I think what this means is that I need to add a glob iterator to |
This comment has been minimized.
This comment has been minimized.
The other other alternative is to use the standard Windows APIs for this. It seems like the kinds of globs it supports are not as nice as Unix-style globbing, but perhaps that's what Windows users expect, so it could be defensible to use that. I don't anticipate working on this soon unfortunately. |
BurntSushi
added
the
icebox
label
Mar 13, 2017
This comment has been minimized.
This comment has been minimized.
|
I thinks using the Windows API is better than nothing and probably easier to implement. |
This comment has been minimized.
This comment has been minimized.
|
@troplin Thanks! If you do, I would hope to see the Windows logic put behind a separate crate. :-) (Which could live inside ripgrep, or could be yours to maintain.) |
roblourens
referenced this issue
Apr 5, 2017
Closed
Support filtering search by folder with './' syntax #18334
This comment has been minimized.
This comment has been minimized.
|
Question: should ripgrep support Unix-style globbing here, or should it use the standard |
This comment has been minimized.
This comment has been minimized.
|
Do the windows APIs support anything besides This doesn't affect vscode scenarios, but as a CLI user, I'd prefer more powerful patterns. |
This comment has been minimized.
This comment has been minimized.
sabi0
commented
Sep 26, 2018
|
How about Basically there is already such behavior separation between ripgrep and shell globbing on Linux. And Windows CLI is just an "inferior shell" one might argue. So it would be natural for (emulated) "shell globbing" to work in the shell native way. |
This comment has been minimized.
This comment has been minimized.
HerbM
commented
Oct 28, 2018
•
|
FYI: Current -g switch in RipGrep seems to work fine with ?, *, [class] It does NOT work without the -g (which is as designed but a bit unexpected for a Windows only user.) Worth putting out a Windows specific warning when the last thing on the line is *.txt or similar and nothing to search, instead of the current warning:
Maybe add,
|
troplin commentedNov 13, 2016
On Windows, glob expansion is not done by the shell (cmd.exe), but left to the individual program.
That means, that currently something like this doesn't work:
It tries to open a file called
*.txt, which obviously doesn't exist.