[QBS] Re-do the wildcard implementation.

Ruslan Nigmatullin euroelessar at yandex.ru
Mon Jan 14 17:44:49 CET 2013


One more addition, files: "src/**" is equal to "src/**/*" %) as "the pattern ** used in a pathname expansion context will match all _files_ and zero or more _directories_ and _subdirectories_."

14.01.2013, 16:30, "Ruslan Nigmatullin" <euroelessar at yandex.ru>:
> 14.01.2013, 16:25, "Bornemann Joerg" <Joerg.Bornemann at digia.com>:
>
>>>   So the pattern "src/**/*.cpp" will handle _all_ "*.cpp" files in "src" and all subdirectories of "src", I think this semantic is rather clear and, as we see, it's easy to be documented.
>>  Yes, if ** is just meant as a flag, it's easy.
>
> Not as a flag, but as special entry, which means "zero or more subdirs".
>
>>  Would this be allowed: "artwork/**/subdir/*.jpg"?
>>  And what does it expand to?
>
> It's interpreted as following:
> 1. Recursivly find all subdirectories "subdir" in directory "artwork".
> 2. Find all "*.jpg" files directly in found "subdir" dirs.
>
> So,
> "artwork/subdir/1.jpg" - ok
> "artwork/foo/subdir/1.jpg" - ok
> "artwork/foo/boo/subdir/1.jpg" - ok
> but
> "artwork/subdir/any/1.jpg" - fail
> "artwork/foo/subdir/any/1.jpg" - fail
> "artwork/foo/boo/subdir/any/1.jpg" - fail
>

--
Ruslan Nigmatullin



More information about the Qbs mailing list