#!/usr/bin/python
import os
import sys
from onl.sysconfig import sysconfig
import yaml

if len(sys.argv) == 2:
    try:
        data = eval("sysconfig.%s" % sys.argv[1])
        if isinstance(data,(type(None),str,int,float,bool)):
            print data
        else:
            print yaml.dump(data, default_flow_style=False)
    except AttributeError, e:
        print "Path %s is not in the config." % sys.argv[1]
        sys.exit(1)
else:
    print sysconfig['OnlSystemConfig'].dump()
