#!/usr/bin/python3

# Simple Python script for pretty-printing JSON files produced by
# "cargo metadata" for better human-readability.

import json
import sys

if len(sys.argv) != 3:
    print("Missing arguments. Usage:", file=sys.stderr)
    print(f"  {sys.argv[0]} INPUT OUTPUT")
    exit(1)

with open(sys.argv[1]) as file:
    data = json.load(file)

with open(sys.argv[2], "w") as file:
    json.dump(data, file, indent=2)

exit(0)
