def METHOD_NAME(self, options: Values, args: List[str]) -> int:
    handlers = {
        "dir": self.get_cache_dir,
        "info": self.get_cache_info,
        "list": self.list_cache_items,
        "remove": self.remove_cache_items,
        "purge": self.purge_cache,
    }
    if not options.cache_dir:
        logger.error("pip cache commands can not function since cache is disabled.")
        return ERROR
    # Determine action
    if not args or args[0] not in handlers:
        logger.error(
            "Need an action (%s) to perform.",
            ", ".join(sorted(handlers)),
        )
        return ERROR
    action = args[0]
    # Error handling happens here, not in the action-handlers.
    try:
        handlers[action](options, args[1:])
    except PipError as e:
        logger.error(e.args[0])
        return ERROR
    return SUCCESS