def main():
    parser = argparse.ArgumentParser(description='Loads a jsop API for snuggle')
    parser.add_argument('config', type=load_config, help='the path to the configuration file')
    parser.add_argument('-p', '--profile', action='store_true', default=False, help='run in profile mode?')
    parser.add_argument('-d', '--debug', action='store_true', default=False, help='print debugging output?')
    args = parser.parse_args()
    LOGGING_STREAM = sys.stderr
    logging.basicConfig(level=(logging.DEBUG if args.debug else logging.INFO), stream=LOGGING_STREAM, format='%(asctime)s %(levelname)-8s %(message)s', datefmt='%b-%d %H:%M:%S')
    if args.profile:
        try:
            import pstats
            import cProfile as profile
        except ImportError:
            import profile
        f = tempfile.NamedTemporaryFile()
        profile.runctx('run(args.config)', globals(), locals(), f.name)
        p = pstats.Stats(f.name)
        p.strip_dirs().sort_stats('time').print_stats(10)
    else:
        run(args.config)
def main():
    parser = argparse.ArgumentParser(description='Loads a jsop API for snuggle')
    parser.add_argument('config', type=load_config, help='the path to the configuration file')
    parser.add_argument('-p', '--profile', action='store_true', default=False, help='run in profile mode?')
    parser.add_argument('-d', '--debug', action='store_true', default=False, help='print debugging output?')
    args = parser.parse_args()
    LOGGING_STREAM = sys.stderr
    logging.basicConfig(level=(logging.DEBUG if args.debug else logging.INFO), stream=LOGGING_STREAM, format='%(asctime)s %(levelname)-8s %(message)s', datefmt='%b-%d %H:%M:%S')
    if args.profile:
        try:
            import pstats
            import cProfile as profile
        except ImportError:
            import profile
        f = tempfile.NamedTemporaryFile()
        profile.runctx('run(args.config)', globals(), locals(), f.name)
        p = pstats.Stats(f.name)
        p.strip_dirs().sort_stats('time').print_stats(10)
    else:
        run(args.config)