Mercurial > python-cmd2
comparison cmd2.py @ 164:5209d230f96b
about to get rid of useTerminatorFrom
author | catherine@dellzilla |
---|---|
date | Thu, 04 Dec 2008 14:01:16 -0500 |
parents | 61a57c44cd93 |
children | 3dc882a00e53 |
comparison
equal
deleted
inserted
replaced
163:61a57c44cd93 | 164:5209d230f96b |
---|---|
415 for (shortcut, expansion) in self.shortcuts.items(): | 415 for (shortcut, expansion) in self.shortcuts.items(): |
416 if s.startswith(shortcut): | 416 if s.startswith(shortcut): |
417 s = s.replace(shortcut, expansion + ' ', 1) | 417 s = s.replace(shortcut, expansion + ' ', 1) |
418 break | 418 break |
419 result = self.parser.parseString(s) | 419 result = self.parser.parseString(s) |
420 result['command'] = result.multilineCommand or result.command | |
420 if useTerminatorFrom: | 421 if useTerminatorFrom: |
421 return self.parsed('%s %s%s%s' % (result.command, result.args, useTerminatorFrom.parsed.terminator, useTerminatorFrom.parsed.suffix)) | 422 return self.parsed('%s %s%s%s' % (result.command, result.args, useTerminatorFrom.parsed.terminator, useTerminatorFrom.parsed.suffix)) |
422 result['command'] = result.multilineCommand or result.command | |
423 result['raw'] = raw | 423 result['raw'] = raw |
424 result['clean'] = self.commentGrammars.transformString(result.args) | 424 result['clean'] = self.commentGrammars.transformString(result.args) |
425 result['expanded'] = s | 425 result['expanded'] = s |
426 p = ParsedString(result.args) | 426 p = ParsedString(result.args) |
427 p.parsed = result | 427 p.parsed = result |