def main():
    cmd = clg.CommandLine(CMD)
    global args
    args = cmd.parse()
    global shell
    shell = args.command0

    if args.format == 'yaml':
        import yaml
        config = yaml.load(open(args.conf_file), Loader=clg.YAMLOrderedDictLoader)
    elif args.format == 'json':
        import simplejson as json
        config = json.loads(open('command.json'), object_pairs_hook=OrderedDict)

    functions = '\n'.join(
        parse_config(shell, '_%s' % args.prog, config, [], args.ignore_options))
    script = {
        'bash': lambda: BASH_SCRIPT.format(prog=args.prog, functions=functions),
        'zsh': lambda: ZSH_SCRIPT.format(prog=args.prog, functions=functions,
            command=SIMPLE_COMMAND if args.simple else MENU_COMMAND,
            ext='' if args.simple else '_desc')
    }[shell]()

    with open(args.output_file, 'w') as fhandler:
        fhandler.write(script)
dataset/ETHPy150Open fmenabe/python-clg/gencomp.py/main/original