summaryrefslogtreecommitdiff
path: root/cmd2.py
diff options
context:
space:
mode:
authorCatherine Devlin <catherine.devlin@gmail.com>2009-03-24 14:11:49 -0400
committerCatherine Devlin <catherine.devlin@gmail.com>2009-03-24 14:11:49 -0400
commitd232e8dddd1f94eeb4579d02a7947cda9767d0a6 (patch)
tree0ac486def0421920c4836b66f2df78940afcb2d4 /cmd2.py
parent661879713682aa4c8dc532cf1d5d62fcc3bb0764 (diff)
downloadcmd2-git-d232e8dddd1f94eeb4579d02a7947cda9767d0a6.tar.gz
fixed bug in abbreviated commands
Diffstat (limited to 'cmd2.py')
-rwxr-xr-xcmd2.py9
1 files changed, 3 insertions, 6 deletions
diff --git a/cmd2.py b/cmd2.py
index 7b6842f7..673fc3cf 100755
--- a/cmd2.py
+++ b/cmd2.py
@@ -283,8 +283,7 @@ class Cmd(cmd.Cmd):
self.stdout.write("""
Commands are %(casesensitive)scase-sensitive.
Commands may be terminated with: %(terminators)s
- Settable parameters: %(settable)s
- """ %
+ Settable parameters: %(settable)s\n""" % \
{ 'casesensitive': (self.case_insensitive and 'not ') or '',
'terminators': str(self.terminators),
'settable': ' '.join(self.settable)
@@ -624,10 +623,10 @@ class Cmd(cmd.Cmd):
except AttributeError:
func = None
if self.abbrev: # accept shortened versions of commands
- funcs = [f for (fname, function) in inspect.getmembers(self, inspect.ismethod)
+ funcs = [(fname, function) for (fname, function) in inspect.getmembers(self, inspect.ismethod)
if fname.startswith('do_' + statement.parsed.command)]
if len(funcs) == 1:
- func = funcs[0]
+ func = funcs[0][1]
if not func:
return self.postparsing_postcmd(self.default(statement))
timestart = datetime.datetime.now()
@@ -809,8 +808,6 @@ class Cmd(cmd.Cmd):
self.pystate[self.nonpythoncommand] = onecmd
try:
interp.interact()
- except SystemExit:
- quit()
except EmbeddedConsoleExit:
return