Entrypoint.

def main(argv=None):
    """
    Entrypoint.
    """
    if argv is None:
        argv = sys.argv

    psr = option_parser()
    args = psr.parse_args(argv[1:])

    if not args.template:
        if args.list_engines:
            ecs = anytemplate.api.list_engines()
            print(", ".join("%s (%s)" % (e.name(), e.priority()) for e in ecs))
            sys.exit(0)
        else:
            psr.print_usage()
            sys.exit(1)

    LOGGER.setLevel(get_loglevel(args.verbose))

    ctx = {}

    if args.contexts:
        LOGGER.info("Loading contexts: %r ...", args.contexts[:3])
        ctx = anytemplate.utils.parse_and_load_contexts(args.contexts,
                                                        args.schema)
    anytemplate.api.render_to(args.template, ctx, args.output,
                              at_paths=args.template_paths,
                              at_engine=args.engine, at_ask_missing=True)