djm99 - 2013-02-19

The use of "exclude" seems to make more sense.
I understand you can add a directory but exclude certain file patterns.
eg to add the directory core to an archive but not any files which are in
subdirectories named ".svn" I would use

     7z a tst.7z -r core -x!*/.svn/

Seems to make good sense to me.

How would I add a certain directory but only files in it (and its subdirectories)
which match a certain pattern.
I would have thought that this is what "include" is for.

eg to add only .cpp and .h files in the supp/lang/code/ dir (and its
subdirectories) I could do

    7z a tst.7z  -r   supp/lang/code/*.cpp  supp/lang/code/*.h

but its not very elegant, especially if I add more file types, or the path is longer
It would be nice to be able to do something like

    7z a tst.7z  supp/lang/code -i!*.cpp -i!*.h

But this seems to add everything in supp/lang/code (not just .h and .cpp).
Is there some way like this possible?
Is this what include is for.
If not what is it for?

Thanks very much in Advance.