Manage flags for package upgrade option

def __pkg_upgrade_flags(self, flags):
        """Manage flags for package upgrade option
        """
        flag, skip = [], ""
        if flags[0] in self.args:
            for arg in self.args[3:]:
                if arg.startswith(flags[1]):
                    skip = Regex(arg.split("=")[1]).get()
                    self.args.remove(arg)
                if arg in flags:
                    flag.append(arg)
                    if arg in self.args:
                        self.args.remove(arg)
        return flag, skip