8 parser = argparse.ArgumentParser()
10 parser.add_argument('--start', type=int, default=0)
11 parser.add_argument('--end', type=int, default=(1 << 32))
12 parser.add_argument('command', nargs='+')
14 args = parser.parse_args()
19 print("Bisect Starting!")
20 print("Start: %d" % start)
21 print("End: %d" % end)
24 while start != end and start != end-1:
25 count = start + (end - start)/2
26 print("Visiting Count: %d with (Start, End) = (%d,%d)" % (count, start, end))
27 cmd = [x % {'count':count} for x in args.command]
29 result = subprocess.call(cmd)
31 print(" PASSES! Setting start to count")
34 print(" FAILS! Setting end to count")
37 print("Last good count: %d" % start)