def METHOD_NAME(self, config):
    tree = config.get("variants.tree")
    summary = config.get("variants.summary")
    variants = config.get("variants.variants")
    contents = config.get("variants.contents")
    inherit = config.get("variants.inherit")
    err = None
    if tree and config.get("variants.debug"):
        err = "Option --tree is incompatible with --debug."
    elif not tree and inherit:
        err = "Option --inherit can be only used with --tree"
    if err:
        LOG_UI.error(err)
        sys.exit(exit_codes.AVOCADO_FAIL)
    varianter = Varianter()
    try:
        varianter.parse(config)
    except (IOError, ValueError) as details:
        LOG_UI.error("Unable to parse varianter: %s", details)
        sys.exit(exit_codes.AVOCADO_FAIL)
    # Parse obsolete options (unsafe to combine them with new args)
    if tree:
        variants = 0
        summary += 1
        if contents:
            summary += 1
        if inherit:
            summary += 2
    else:
        if contents:
            variants += 2
    json_variants_dump = config.get("variants.json_variants_dump")
    # Export the serialized variants
    if json_variants_dump is not None:
        try:
            with open(json_variants_dump, "w", encoding="utf-8") as variants_file:
                json.dump(varianter.dump(), variants_file)
        except IOError:
            LOG_UI.error("Cannot write %s", json_variants_dump)
            sys.exit(exit_codes.AVOCADO_FAIL)
    # Produce the output
    lines = varianter.to_str(
        summary=summary,
        variants=variants,
        use_utf8=sys.getdefaultencoding() == "utf-8",
    )
    for line in lines.splitlines():
        LOG_UI.debug(line)
    sys.exit(exit_codes.AVOCADO_ALL_OK)