changeset 195:455ebe415d5e 0.4.6

do not interpret => as having the redirector >
author catherine@dellzilla
date Wed, 25 Feb 2009 14:00:43 -0500
parents 5bf878c5c0e8
children f73cde93ce73
files cmd2.py
diffstat 1 files changed, 3 insertions(+), 1 deletions(-) [+]
line wrap: on
line diff
--- a/cmd2.py	Wed Feb 18 04:26:55 2009 -0500
+++ b/cmd2.py	Wed Feb 25 14:00:43 2009 -0500
@@ -370,7 +370,9 @@
           - terminator: ['\n', '\n']
         - terminator: ['\n', '\n']
         '''
-        outputParser = pyparsing.oneOf(['>>','>'])('output')
+        #outputParser = pyparsing.oneOf(['>>','>'])('output')
+        outputParser = (pyparsing.Literal('>>') | (pyparsing.WordStart() + '>') | pyparsing.Regex('[^=]>'))('output')
+        
         terminatorParser = pyparsing.Or([(hasattr(t, 'parseString') and t) or pyparsing.Literal(t) for t in self.terminators])('terminator')
         stringEnd = pyparsing.stringEnd ^ '\nEOF'
         self.multilineCommand = pyparsing.Or([pyparsing.Keyword(c, caseless=self.caseInsensitive) for c in self.multilineCommands])('multilineCommand')