From 3ef2c9f6d7c79120e0a1ed4e705c613d2abd8684 Mon Sep 17 00:00:00 2001 From: "Michael J. Spencer" Date: Tue, 5 Oct 2010 17:56:46 +0000 Subject: [PATCH] test/coff-dump: Support reading from stdin. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@115640 91177308-0d34-0410-b5e6-96231b3b80d8 --- test/Scripts/coff-dump.py | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/test/Scripts/coff-dump.py b/test/Scripts/coff-dump.py index 7868c006a43..d734f0a0133 100755 --- a/test/Scripts/coff-dump.py +++ b/test/Scripts/coff-dump.py @@ -560,7 +560,12 @@ def handle_element(entry): return handlers[entry[0]](entry) -Input = open (sys.argv[1], "rb") +if len(sys.argv) <= 1 or sys.argv[1] == '-': + import StringIO + Input = StringIO.StringIO(sys.stdin.read()) +else: + Input = open (sys.argv[1], "rb") + try: handle_element(file) finally: -- 2.34.1