default=[stdin],
help="djbdns logfile to process (default: stdin)")
+ # Warning: argparse automatically opens its file arguments here,
+ # and they only get closed when the program terminates. There's no
+ # real benefit to closing them one-at-a-time after calling
+ # parse_logfile(), because the "scarce" resource of open file
+ # descriptors gets consumed immediately, before any processing has
+ # happened. In other words, if you're going to run out of file
+ # descriptors, it's going to happen right now.
+ #
+ # So anyway, don't run this on several million logfiles.
args = parser.parse_args()
for f in args.logfiles:
parse_logfile(f)