1*1f5207b7SJohn Levonimport argparse 2*1f5207b7SJohn Levonimport sys 3*1f5207b7SJohn Levon 4*1f5207b7SJohn Levonfrom constants import ( 5*1f5207b7SJohn Levon IMPL_DEP_FILE_STR, 6*1f5207b7SJohn Levon OUTPUT_FILE_STR, 7*1f5207b7SJohn Levon) 8*1f5207b7SJohn Levonfrom parser import Parser 9*1f5207b7SJohn Levon 10*1f5207b7SJohn Levondef main(): 11*1f5207b7SJohn Levon arg_parser = argparse.ArgumentParser( 12*1f5207b7SJohn Levon description="Control module for tracking implicit dependencies" 13*1f5207b7SJohn Levon ) 14*1f5207b7SJohn Levon arg_parser.add_argument( 15*1f5207b7SJohn Levon "-f", "--file", default=IMPL_DEP_FILE_STR, 16*1f5207b7SJohn Levon help="path to kernel.implicit_dependencies", 17*1f5207b7SJohn Levon ) 18*1f5207b7SJohn Levon arg_parser.add_argument( 19*1f5207b7SJohn Levon "-o", "--output", default=OUTPUT_FILE_STR, 20*1f5207b7SJohn Levon help="where to output info", 21*1f5207b7SJohn Levon ) 22*1f5207b7SJohn Levon arg_parser.add_argument( 23*1f5207b7SJohn Levon "-v", "--verbose", action="store_true", 24*1f5207b7SJohn Levon help="if verbose, we list what fields are responsible for the dependency" 25*1f5207b7SJohn Levon ) 26*1f5207b7SJohn Levon arg_parser.add_argument( 27*1f5207b7SJohn Levon "-p", "--pretty", action="store_true", 28*1f5207b7SJohn Levon help="print implicit dependencies in pretty format" 29*1f5207b7SJohn Levon ) 30*1f5207b7SJohn Levon args = arg_parser.parse_args() 31*1f5207b7SJohn Levon 32*1f5207b7SJohn Levon p = Parser(args.file, output_file_str=args.output, verbose=args.verbose, pretty=args.pretty) 33*1f5207b7SJohn Levon p.parse() 34*1f5207b7SJohn Levon p.write() 35*1f5207b7SJohn Levon p.close() 36*1f5207b7SJohn Levon 37*1f5207b7SJohn Levon 38*1f5207b7SJohn Levonif __name__ == "__main__": 39*1f5207b7SJohn Levon sys.exit(main()) 40