@@ -0,0 +1,1433 @@
+#!/usr/bin/env python%0A%22%22%22%0A%22%22%22%0Aimport argparse%0Aimport json%0Aimport sys%0A%0A%0A__version__ = '0.1.0'%0A%0A%0Adef create_arg_parser():%0A    parser = argparse.ArgumentParser(%0A        description='Prettify JSON',%0A    )%0A    parser.add_argument(%0A        'infile',%0A        nargs='?',%0A        type=argparse.FileType('r'),%0A        default=sys.stdin,%0A        help='The input file %5Bdefault=stdin%5D',%0A    )%0A    parser.add_argument(%0A        'outfile',%0A        nargs='?',%0A        type=argparse.FileType('w'),%0A        default=sys.stdout,%0A        help='The output file %5Bdefault=stdout%5D',%0A    )%0A    parser.add_argument(%0A        '-i', '--indent',%0A        type=int,%0A        default=2,%0A        help='Number of spaces to indent each level %5Bdefault=%25(default)s%5D',%0A    )%0A    parser.add_argument(%0A        '--version',%0A        action='version',%0A        version='%25(prog)s ' + __version__,%0A    )%0A%0A    return parser%0A%0A%0Adef main(infile, outfile, indention=2, separators=(',', ': ')):%0A    with infile:%0A        try:%0A            obj = json.load(infile)%0A        except ValueError, e:%0A            raise SystemExit(e)%0A%0A    with outfile:%0A        json.dump(%0A            obj,%0A            outfile,%0A            sort_keys=True,%0A            indent=indention,%0A            separators=separators,%0A        )%0A        outfile.write('%5Cn')%0A%0A%0Aif __name__ == '__main__':%0A    parser = create_arg_parser()%0A    args = parser.parse_args()%0A    main(args.infile, args.outfile, args.indent)%0A    #sys.exit(0)%0A

Add format-json.py utility to /bin