diff options
| author | Catherine Devlin <catherine.devlin@gmail.com> | 2009-03-24 14:11:49 -0400 |
|---|---|---|
| committer | Catherine Devlin <catherine.devlin@gmail.com> | 2009-03-24 14:11:49 -0400 |
| commit | d232e8dddd1f94eeb4579d02a7947cda9767d0a6 (patch) | |
| tree | 0ac486def0421920c4836b66f2df78940afcb2d4 /cmd2.py | |
| parent | 661879713682aa4c8dc532cf1d5d62fcc3bb0764 (diff) | |
| download | cmd2-git-d232e8dddd1f94eeb4579d02a7947cda9767d0a6.tar.gz | |
fixed bug in abbreviated commands
Diffstat (limited to 'cmd2.py')
| -rwxr-xr-x | cmd2.py | 9 |
1 files changed, 3 insertions, 6 deletions
@@ -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 |
