Index: tools/json_schema_compiler/idl_schema.py |
diff --git a/tools/json_schema_compiler/idl_schema.py b/tools/json_schema_compiler/idl_schema.py |
index 72e4d13b4fd67c9464343d40f40b6c75d3a1e937..89bb8816b0c82f9237e4f14ca287861c5a036d60 100644 |
--- a/tools/json_schema_compiler/idl_schema.py |
+++ b/tools/json_schema_compiler/idl_schema.py |
@@ -469,8 +469,14 @@ def Main(): |
Dump a json serialization of parse result for the IDL files whose names |
were passed in on the command line. |
''' |
- for filename in sys.argv[1:]: |
- schema = Load(filename) |
+ if len(sys.argv) > 1: |
+ for filename in sys.argv[1:]: |
+ schema = Load(filename) |
+ print json.dumps(schema, indent=2) |
+ else: |
+ contents = sys.stdin.read() |
+ idl = idl_parser.IDLParser().ParseData(contents, '<stdin>') |
+ schema = IDLSchema(idl).process() |
print json.dumps(schema, indent=2) |