summaryrefslogtreecommitdiff
path: root/prettyml
diff options
context:
space:
mode:
authorLars Wirzenius <liw@liw.fi>2016-02-29 21:14:48 +0200
committerLars Wirzenius <liw@liw.fi>2016-02-29 21:14:48 +0200
commit1eab650c0daf312782548f4332f2998da5f0a954 (patch)
tree00a117b8dd3d8d0becf5bc395aa856be85146d44 /prettyml
parent1bc5029024cadbbcd5d3f71c46bde391db454095 (diff)
downloadextrautils-1eab650c0daf312782548f4332f2998da5f0a954.tar.gz
Add prettyml, prettyson
Diffstat (limited to 'prettyml')
-rwxr-xr-xprettyml11
1 files changed, 11 insertions, 0 deletions
diff --git a/prettyml b/prettyml
new file mode 100755
index 0000000..fe9f468
--- /dev/null
+++ b/prettyml
@@ -0,0 +1,11 @@
+#!/usr/bin/python
+
+import sys
+
+import yaml
+
+objs = []
+for filename in sys.argv[1:]:
+ with open(filename) as f:
+ objs.append(yaml.safe_load(f))
+yaml.safe_dump_all(objs, stream=sys.stdout, indent=4, default_flow_style=False)