Currently, unless I'm mistaken, if a program wants to support pattern-matching from the command line it's a manual process of:
* ParsePattern/NoCase
* MatchPattern/NoCase against each entry of a previously-obtained directory scan.
This is tedious and might be why we have to resort to SPAT much of the time to operate on multiple files.
I suggest an addition to ReadArgs:
/P - This switch means that wildcards will be expanded, so the application receives an array of filenames matching the pattern passed in (relative to the current directory if a full path was not provided). If no filesystem objects matched the pattern the first entry in the array will be NULL. When combined with /M the user will be able to specify multiple optionally wildcarded strings which will all be expanded into the same array.
Automatic wildcard expansion
- thomasrapp
- Posts: 310
- Joined: Sat Jun 18, 2011 11:22 pm
Re: Automatic wildcard expansion
Such an array could be *very* large.
I suggest to use MatchFirst/MatchNext instead which is meant for this kind of thing.
I suggest to use MatchFirst/MatchNext instead which is meant for this kind of thing.