#!/usr/bin/python

import subprocess
import sys

#DIRECTORIES_SEARCH = ['analysis/', 'bench/','build/','cdn/','cppoh/','cseg/','demo/','doc/','externals/','libcore/','libproxyobject/','libspace/','pinto/','scripts/','simoh/','space/','tools/'];

#Excludes build and externals and scripts
DIRECTORIES_SEARCH = ['analysis/', 'bench/','cdn/','cppoh/','cseg/','demo/','doc/','libcore/','libmesh','liboh','libproxyobject/','libspace/','pinto/','simoh/','space/','tools/'];


if __name__ == "__main__":

    if (len (sys.argv) < 2):
        print("\n\nIncorrect usage: add in what you're grepping for\n\n");

    
    #cmd = ['grep','-R', sys.argv[1]];
    cmd = ['grep','-R'];
    cmd += sys.argv[1:];
    cmd += DIRECTORIES_SEARCH;
    
    subprocess.call(cmd);
    

#!/usr/bin/python

import subprocess
import sys

EXCLUDES = [ 'dependencies', 'externals', 'scripts', 'build/cmake', 'build/Frameworks', '.git' ]

if __name__ == "__main__":
    if (len (sys.argv) < 2):
        print("\n\nIncorrect usage: add in what you're grepping for\n\n")

    #cmd = ['grep','-R', sys.argv[1]]
    cmd = ['grep','-R']
    cmd += [ '--exclude-dir=' + e for e in EXCLUDES ]
    cmd += sys.argv[1:]
    cmd += [ '.' ]

    subprocess.call(cmd);

Make sgrep.py use a blacklist rather than whitelist so it covers everything, even when people add new directories.