7 from headerutils import *
25 for x in sys.argv[1:]:
30 elif x[0:2] == "-s" or x[0:2] == "-c":
37 num_match = int(x[2:])
43 file_list = open (x[2:]).read().splitlines()
46 print "Error: Unknown option " + x
54 if not process_h and not process_c:
64 file_list = find_gcc_files ("\*.h", current, deeper)
66 file_list = file_list + find_gcc_files ("\*.c", current, deeper)
67 file_list = file_list + find_gcc_files ("\*.cc", current, deeper)
71 if process_h and x[-2:] == ".h":
73 elif process_c and (x[-2:] == ".c" or x[-3:] == ".cc"):
79 found = find_unique_include_list (fn)
84 careabout.append (inc)
88 output = output + " [" + inc +"]"
89 if len (careabout) < num_match:
94 print "included-by [-h] [-i] [-c] [-v] [-a] [-nx] file1 [file2] ... [filen]"
95 print "find the list of all files in subdirectories that include any of "
96 print "the listed files. processed to a depth of 3 subdirs"
97 print " -h : Show this message"
98 print " -i : process only header files (*.h) for #include"
99 print " -c : process only source files (*.c *.cc) for #include"
100 print " If nothing is specified, defaults to -i -c"
101 print " -s : Same as -c."
102 print " -v : Show which include(s) were found"
103 print " -nx : Only list files which have at least x different matches. Default = 1"
104 print " -a : Show only files which all listed files are included"
105 print " This is equivilent to -nT where T == # of items in list"
106 print " -flistfile : Show only files contained in the list of files"