# HG changeset patch # User catherine@localhost # Date 1211225022 14400 # Node ID a974e2f44cbeff9aaf1a91d8be22164b526f5f28 # Parent f472921d6189da38ace4ab328b10898c28cb8ea3 made redirectors work with app-specific StatementEndPattern diff -r f472921d6189 -r a974e2f44cbe cmd2.py --- a/cmd2.py Mon May 19 13:56:00 2008 -0400 +++ b/cmd2.py Mon May 19 15:23:42 2008 -0400 @@ -46,13 +46,14 @@ def newFunc(instance, arg): try: opts, arg = optionParser.parse_args(arg.split()) + arg = ' '.join(arg) except (optparse.OptionValueError, optparse.BadOptionError, optparse.OptionError, optparse.AmbiguousOptionError, optparse.OptionConflictError), e: print e optionParser.print_help() return - result = func(instance, ' '.join(arg), opts) + result = func(instance, arg, opts) return result newFunc.__doc__ = '%s\n%s' % (func.__doc__, optionParser.format_help()) return newFunc @@ -177,7 +178,7 @@ parts = statement.split(symbol) if (len(parts) < 2): return statement, None - if mustBeTerminated and (parts[-2].strip()[-1] not in self.terminators): + if mustBeTerminated and (not self.statementEndPattern.search(parts[-2])): return statement, None (newStatement, redirect) = (symbol.join(parts[:-1]), parts[-1].strip()) if redirect: