Automatic wildcard expansion

AmigaOS users can make feature requests in this forum.
Post Reply
chris
Posts: 562
Joined: Sat Jun 18, 2011 11:05 am
Contact:

Automatic wildcard expansion

Post by chris »

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.
User avatar
thomasrapp
Posts: 310
Joined: Sat Jun 18, 2011 11:22 pm

Re: Automatic wildcard expansion

Post by thomasrapp »

Such an array could be *very* large.

I suggest to use MatchFirst/MatchNext instead which is meant for this kind of thing.
Post Reply