Evaluate only the options and return flags as suggestions

def evalOptions(self, root, parsed, unparsed):
        """ Evaluate only the options and return flags as suggestions """
        logger.debug("parsing options at tree: %s with p:%s, u:%s", root.node, parsed, unparsed)
        suggestions = dict()
        token = unparsed.pop().strip()

        parts = token.partition('=')
        if parts[-1] != '':  # parsing for --option=value type input
            token = parts[0]

        allFlags = root.localFlags + self.globalFlags
        for flag in allFlags:
            if flag.name == token:
                logger.debug("matched token: %s with flag: %s", token, flag.name)
                parsed.append(token)
                if self.peekForOption(unparsed):  # recursively look for further options
                    parsed, unparsed, suggestions = self.evalOptions(root, parsed, unparsed[:])
                # elif token == "--namespace":
                #     namespaces = [('default', None), ('minikube', None), ('gitlab', None)]  # self.kube_client.get_resource("namespace")
                #     suggestions = dict(namespaces)
                break
        else:
            logger.debug("no flags match, returning allFlags suggestions")
            for flag in allFlags:
                suggestions[flag.name] = flag.helptext

        if suggestions:  # incomplete parse, replace token
            logger.debug("incomplete option: %s provided. returning suggestions", token)
            unparsed.append(token)
        return parsed, unparsed, suggestions