summaryrefslogtreecommitdiff
path: root/prettyson
diff options
context:
space:
mode:
Diffstat (limited to 'prettyson')
-rwxr-xr-xprettyson11
1 files changed, 7 insertions, 4 deletions
diff --git a/prettyson b/prettyson
index 0a327ad..e2cb0df 100755
--- a/prettyson
+++ b/prettyson
@@ -1,6 +1,8 @@
-#!/usr/bin/python
+#!/usr/bin/python3
+
+import json
+import sys
-import sys, json
def inputs(args):
if args:
@@ -8,10 +10,11 @@ def inputs(args):
with open(filename) as f:
yield filename, f
else:
- yield '-', sys.stdin
+ yield "-", sys.stdin
+
objs = []
for filename, f in inputs(sys.argv[1:]):
objs.append(json.load(f))
json.dump(objs, sys.stdout, indent=4)
-sys.stdout.write('\n')
+sys.stdout.write("\n")