237
238 import optparse
239 parser = optparse.OptionParser(description="Create runtime dependecy graph for shared library. The output is a graph in DOT language. To visualize it use, e.g. 'dot -O -Tps mygraph.dot'. The rectangular nodes represent direct dependencies. Nodes belonging to the same project have the same color.",
240 usage="%prog [OPTIONS] LIB [LIB...]")
241
242 parser.add_option("-o", "--output",
243 help="File for DOT source code (default is LIB.dot)")
244
245 parser.add_option("-d", "--maxdepth", type="int",
246 help="Maximum depth of dependency tree [1..]")
247
248 parser.add_option("-f", "--filter", action="append",
249 help="Only analyze libraries matching regular expression (can be specified multiple times) [default: .*atlas/software.*]")
250
251 parser.add_option("--nocolor", action="store_true",
252 help="Do not use colors")
253
254 parser.add_option("-s", "--stats", action="store_true",
255 help="Print statistics")
256
257 (opt, args) = parser.parse_args()
258 if len(args)==0:
259 parser.error("Invalid number of arguments specified")
260
261
262 if len(args)>1 and opt.output:
263 print ("Multiple libraries specified. Ignoring output file name.")
264 opt.output = None
265
266 for lib in args:
267 processLib(lib, opt, opt.output)
268
269 if opt.stats:
270 printStats()
271
272 return 0
273
274