yaml-tidy

Sat, 17 Dec 2011 17:08:33 +0000

author
Matthew Wild <mwild1@gmail.com>
date
Sat, 17 Dec 2011 17:08:33 +0000
changeset 0
0757d85e604b
permissions
-rwxr-xr-x

Initial commit

0
0757d85e604b Initial commit
Matthew Wild <mwild1@gmail.com>
parents:
diff changeset
1 #!/usr/bin/env lua5.1
0757d85e604b Initial commit
Matthew Wild <mwild1@gmail.com>
parents:
diff changeset
2
0757d85e604b Initial commit
Matthew Wild <mwild1@gmail.com>
parents:
diff changeset
3 local yaml = require "yaml";
0757d85e604b Initial commit
Matthew Wild <mwild1@gmail.com>
parents:
diff changeset
4
0757d85e604b Initial commit
Matthew Wild <mwild1@gmail.com>
parents:
diff changeset
5 for i, fn in ipairs(arg) do
0757d85e604b Initial commit
Matthew Wild <mwild1@gmail.com>
parents:
diff changeset
6 local f = assert(io.open(fn, "r"));
0757d85e604b Initial commit
Matthew Wild <mwild1@gmail.com>
parents:
diff changeset
7 print(yaml.dump(yaml.load(f:read("*a"))));
0757d85e604b Initial commit
Matthew Wild <mwild1@gmail.com>
parents:
diff changeset
8 f:close();
0757d85e604b Initial commit
Matthew Wild <mwild1@gmail.com>
parents:
diff changeset
9 end
0757d85e604b Initial commit
Matthew Wild <mwild1@gmail.com>
parents:
diff changeset
10

mercurial