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.
(self, line)
| 181 | pass |
| 182 | |
| 183 | def parseline(self, line): |
| 184 | """Parse the line into a command name and a string containing |
| 185 | the arguments. Returns a tuple containing (command, args, line). |
| 186 | 'command' and 'args' may be None if the line couldn't be parsed. |
| 187 | """ |
| 188 | line = line.strip() |
| 189 | if not line: |
| 190 | return None, None, line |
| 191 | elif line[0] == '?': |
| 192 | line = 'help ' + line[1:] |
| 193 | elif line[0] == '!': |
| 194 | if hasattr(self, 'do_shell'): |
| 195 | line = 'shell ' + line[1:] |
| 196 | else: |
| 197 | return None, None, line |
| 198 | i, n = 0, len(line) |
| 199 | while i < n and line[i] in self.identchars: i = i+1 |
| 200 | cmd, arg = line[:i], line[i:].strip() |
| 201 | return cmd, arg, line |
| 202 | |
| 203 | def onecmd(self, line): |
| 204 | """Interpret the argument as though it had been typed in response |
no test coverage detected