def parseline(self, line):
        """Parse the line into a command name and a string containing
        the arguments.  Returns a tuple containing (command, args, line).
        'command' and 'args' may be None if the line couldn't be parsed.

        Similar to cmd.Cmd.parseline()
        """
        if not line:
            self.log.debug(
                '[sref:%s] Parsed line returns: cmd=None, agr=None, line=%s', self.sessionRef, line)
            return None, None, line
        elif line[0] == '?':
            line = 'help ' + line[1:]

        i, n = 0, len(line)
        while i < n and line[i] in self.identchars:
            i = i+1
        cmd, arg = line[:i], line[i:].strip()

        self.log.debug(
            '[sref:%s] Parsed line returns: cmd=%s, agr=%s, line=%s', self.sessionRef, cmd, arg, line)
        return cmd, arg, line
dataset/ETHPy150Open jookies/jasmin/jasmin/protocols/cli/protocol.py/CmdProtocol.parseline/original