#!/bin/python -tt
#vim: set fileencoding=utf-8 :

import os, argparse, json, hashlib

parser = argparse.ArgumentParser()
parser.add_argument('jsonfile')

args = parser.parse_args()
jsonfile = args.jsonfile

keyvalues = ['ENV', 'LABEL', 'ONBUILD']

jsondoc = None

with open(jsonfile) as fp:
	jsondoc = json.load(fp)

for command in jsondoc['commands']:
	if command['type'] in keyvalues:
		print('{0} {1} {2}'.format(command['type'], command['name'], command['value']))
	else:
		print('{0} {1}'.format(command['type'], command['value']))
