Automatic wildcard expansion
Posted: Sun Nov 30, 2014 1:09 am
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.
* 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.