def main(argv=None):
if argv is None:<EOL><INDENT>argv = sys.argv<EOL><DEDENT>psr = option_parser()<EOL>args = psr.parse_args(argv[<NUM_LIT:1>:])<EOL>if not args.template:<EOL><INDENT>if args.list_engines:<EOL><INDENT>ecs = anytemplate.api.list_engines()<EOL>print("<STR_LIT:U+002CU+0020>".join("<STR_LIT>" % (e.name(), e.priority()) for e in ecs))<EOL>sys.exit(<NUM_LIT:0>)<EOL><DEDENT>else:<EOL><INDENT>psr.print_usage()<EOL>sys.exit(<NUM_LIT:1>)<EOL><DEDENT><DEDENT>LOGGER.setLevel(get_loglevel(args.verbose))<EOL>ctx = {}<EOL>if args.contexts:<EOL><INDENT>LOGGER.info("<STR_LIT>", args.contexts[:<NUM_LIT:3>])<EOL>ctx = anytemplate.utils.parse_and_load_contexts(args.contexts,<EOL>args.schema)<EOL><DEDENT>anytemplate.api.render_to(args.template, ctx, args.output,<EOL>at_paths=args.template_paths,<EOL>at_engine=args.engine, at_ask_missing=True)<EOL>
Entrypoint.