summaryrefslogtreecommitdiff
path: root/cmd2.py
diff options
context:
space:
mode:
Diffstat (limited to 'cmd2.py')
-rwxr-xr-xcmd2.py4
1 files changed, 2 insertions, 2 deletions
diff --git a/cmd2.py b/cmd2.py
index 8033b26..6098432 100755
--- a/cmd2.py
+++ b/cmd2.py
@@ -26,7 +26,7 @@ flagReader.py options are still supported for backward compatibility
"""
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 @@ def remainingArgs(oldArgs, newArgList):
>>> 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():]