From: Michael J. Spencer Date: Tue, 5 Oct 2010 17:56:46 +0000 (+0000) Subject: test/coff-dump: Support reading from stdin. X-Git-Url: http://demsky.eecs.uci.edu/git/?a=commitdiff_plain;h=3ef2c9f6d7c79120e0a1ed4e705c613d2abd8684;p=oota-llvm.git test/coff-dump: Support reading from stdin. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@115640 91177308-0d34-0410-b5e6-96231b3b80d8 --- 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: