Back to home page

EIC code displayed by LXR

 
 

    


File indexing completed on 2025-01-18 09:10:44

0001 #!/usr/bin/env python3
0002 import argparse
0003 
0004 p = argparse.ArgumentParser()
0005 p.add_argument("output")
0006 p.add_argument("files", nargs="+")
0007 
0008 args = p.parse_args()
0009 
0010 items = {}
0011 
0012 for file in args.files:
0013     with open(file) as fh:
0014         for line in fh:
0015             key, value = line.split(":", 1)
0016             items[key.strip()] = value.strip()
0017 
0018 with open(args.output, "w") as fh:
0019     for key, value in items.items():
0020         fh.write(f"{key}: {value}\n")