def main():
parser = argparse.ArgumentParser(description=__doc__,
formatter_class=argparse.RawDescriptionHelpFormatter)
- parser.add_argument('-o', '--out', type=argparse.FileType('w'),
+ parser.add_argument('-o', '--out',
help="write model here")
parser.add_argument('--dns-mode', choices=['inline', 'count'],
help='how to deal with DNS', default='count')
error("Please specify a filename using the --out option.")
return 1
+ try:
+ outfile = open(args.out, 'w')
+ except IOError as e:
+ error("could not open %s" % args.out)
+ error(e)
+ return 1
+
if args.SUMMARY_FILE is sys.stdin:
info("reading from STDIN...")