diff cmd2.py @ 163:61a57c44cd93

ugh - parsing stripping command causes real trouble
author catherine@dellzilla
date Wed, 03 Dec 2008 17:21:08 -0500
parents c50615cf814f
children 5209d230f96b
line wrap: on
line diff
--- a/cmd2.py	Tue Dec 02 11:00:41 2008 -0500
+++ b/cmd2.py	Wed Dec 03 17:21:08 2008 -0500
@@ -417,13 +417,12 @@
                 s = s.replace(shortcut, expansion + ' ', 1)
                 break
         result = self.parser.parseString(s)
+        if useTerminatorFrom:
+            return self.parsed('%s %s%s%s' % (result.command, result.args, useTerminatorFrom.parsed.terminator, useTerminatorFrom.parsed.suffix))
         result['command'] = result.multilineCommand or result.command
         result['raw'] = raw
         result['clean'] = self.commentGrammars.transformString(result.args)
-        result['expanded'] = s
-        if useTerminatorFrom:
-            result['terminator'] = useTerminatorFrom.parsed.terminator
-            result['suffix'] = useTerminatorFrom.parsed.suffix
+        result['expanded'] = s        
         p = ParsedString(result.args)
         p.parsed = result
         p.parser = self.parsed
@@ -608,7 +607,7 @@
             if (val[0] == val[-1]) and val[0] in ("'", '"'):
                 val = val[1:-1]
             else:                
-                val = cast(currentVal, self.parsed(val).statement)
+                val = cast(currentVal, val)
             setattr(self, paramName, val)
             self.stdout.write('%s - was: %s\nnow: %s\n' % (paramName, currentVal, val))
         except (ValueError, AttributeError, NotSettableError), e: