pysvp64dis: dump to output file; use explicit arguments
authorDmitry Selyutin <ghostmansd@gmail.com>
Tue, 16 Aug 2022 18:43:26 +0000 (21:43 +0300)
committerLuke Kenneth Casson Leighton <lkcl@lkcl.net>
Mon, 29 Aug 2022 19:38:10 +0000 (20:38 +0100)
src/openpower/sv/trans/pysvp64dis.py

index 6f8d4cf4a4002a150b168884480f05763077adf0..4bd056f998c9bcf7b70135033e27562629798c1c 100644 (file)
@@ -111,11 +111,15 @@ def main():
         type=_argparse.FileType("w"), default=_sys.stdout)
     parser.add_argument("-b", "--byteorder",
         type=ByteOrder, default=ByteOrder.LITTLE)
+
     args = dict(vars(parser.parse_args()))
+    ifile = args["ifile"]
+    ofile = args["ofile"]
+    byteorder = args["byteorder"]
 
-    insns = load(**args)
-    for line in dump(insns, **args):
-        print(line)
+    insns = load(ifile, byteorder)
+    for line in dump(insns, byteorder):
+        print(line, file=ofile)
 
 
 if __name__ == "__main__":