# HG changeset patch # User catherine@Elli.myhome.westell.com # Date 1237811523 14400 # Node ID 68b444aeaf8bbdff2889067b67c6321292ecf887 # Parent 82b6e0881b7810cdf10c882eb3e642154b8247f3 now abbrevs and synonyms do not clash diff -r 82b6e0881b78 -r 68b444aeaf8b cmd2.py --- a/cmd2.py Mon Mar 23 05:54:43 2009 -0400 +++ b/cmd2.py Mon Mar 23 08:32:03 2009 -0400 @@ -588,18 +588,18 @@ self.stdout.write(getPasteBuffer()) try: # "heart" of the command, replace's cmd's onecmd() - self.lastcmd = statement.parsed.expanded - if self.abbrev: # accept shortened versions of commands - funcs = [func for (fname, func) in inspect.getmembers(self, inspect.ismethod) - if fname.startswith('do_' + statement.parsed.command)] - if len(funcs) == 1: - func = funcs[0] - else: - return self.postparsing_postcmd(self.default(statement)) - else: - try: - func = getattr(self, 'do_' + statement.parsed.command) - except AttributeError: + self.lastcmd = statement.parsed.expanded + try: + func = getattr(self, 'do_' + statement.parsed.command) + except AttributeError: + func = None + if self.abbrev: # accept shortened versions of commands + funcs = [func for (fname, func) in inspect.getmembers( + self, inspect.ismethod) + if fname.startswith('do_' + statement.parsed.command)] + if len(funcs) == 1: + func = funcs[0] + if not func: return self.postparsing_postcmd(self.default(statement)) timestart = datetime.datetime.now() stop = func(statement)