#!/usr/bin/env php
<?php

if (file_exists(__DIR__."/../vendor/autoload.php"))
    require_once __DIR__."/../vendor/autoload.php";
else
    require_once __DIR__."/../../../autoload.php";

use NoccyLabs\Pson\Pson;

if ($argc > 1) {
    $data = $argv[1];
} else {
    $data = stream_get_contents(STDIN);
}
$json = Pson::decode($data);
$json = json_encode($json, JSON_PRETTY_PRINT|JSON_UNESCAPED_SLASHES);

echo $json."\n";