def parse(self, argv=None):
        """
        Parse argv of terminal

        :param argv: default is sys.argv
        """

        if not argv:
            argv = sys.argv
        elif isinstance(argv, str):
            argv = argv.split()

        self._argv = argv[1:]
        if not self._argv:
            self.validate_options()
            if self._command_func:
                self._command_func(**self._results)
                return True
            return False

        cmd = self._argv[0]

        if not cmd.startswith('-'):
            # parse subcommands
            for command in self._command_list:
                if isinstance(command, Command) and command._name == cmd:
                    command._parent = self
                    return command.parse(self._argv)

        _positional_index = 0
        while self._argv:
            arg = self._argv[0]
            self._argv = self._argv[1:]
            if not self.parse_options(arg):
                self._args_results.append(arg)
                if _positional_index > len(self._positional_list):
                    # positional arguments
                    key = self._positional_list[_positional_index]
                    self._results[key] = arg
                    _positional_index += 1

        # validate
        self.validate_options()

        if self._parent and isinstance(self._parent, Command):
            self._parent._args_results = self._args_results

        if self._command_func:
            self._command_func(**self._results)
            return True
        return False
dataset/ETHPy150Open lepture/terminal/terminal/command.py/Command.parse/swapped operands of `>`