# HG changeset patch # User catherine@dellzilla # Date 1237918309 14400 # Node ID e91808980e5978c83cd9acde3257d0f5ef3121a0 # Parent 035330ccfcf0df2c6d7e7f063ee93ba69e6c1da0 fixed bug in abbreviated commands diff -r 035330ccfcf0 -r e91808980e59 cmd2.py --- a/cmd2.py Tue Mar 24 13:59:00 2009 -0400 +++ b/cmd2.py Tue Mar 24 14:11:49 2009 -0400 @@ -283,8 +283,7 @@ 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 @@ 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 @@ self.pystate[self.nonpythoncommand] = onecmd try: interp.interact() - except SystemExit: - quit() except EmbeddedConsoleExit: return