# HG changeset patch # User catherine@Elli.myhome.westell.com # Date 1233312792 18000 # Node ID 06119abd352e3e190ee55dd9b5a2215c50e69dbd # Parent 7ce8db01a847abad34e1c968517ab87a42792eef synch diff -r 7ce8db01a847 -r 06119abd352e cmd2.py --- a/cmd2.py Wed Jan 28 13:14:05 2009 -0500 +++ b/cmd2.py Fri Jan 30 05:53:12 2009 -0500 @@ -26,7 +26,7 @@ """ import cmd, re, os, sys, optparse, subprocess, tempfile, pyparsing, doctest, unittest, string from optparse import make_option -__version__ = '0.4.4' +__version__ = '0.4.5' class OptionParser(optparse.OptionParser): def exit(self, status=0, msg=None): @@ -48,7 +48,7 @@ >>> remainingArgs('-f bar bar cow', ['bar', 'cow']) 'bar cow' ''' - pattern = '\s+'.join(newArgList) + '\s*$' + pattern = '\s+'.join(re.escape(a) for a in newArgList) + '\s*$' matchObj = re.search(pattern, oldArgs) return oldArgs[matchObj.start():] diff -r 7ce8db01a847 -r 06119abd352e setup.py --- a/setup.py Wed Jan 28 13:14:05 2009 -0500 +++ b/setup.py Fri Jan 30 05:53:12 2009 -0500 @@ -3,7 +3,7 @@ setup( name="cmd2", - version="0.4.4", + version="0.4.5", py_modules=["cmd2",], # metadata for upload to PyPI