diff -r a3e48273dce3 Lib/cmd.py --- a/Lib/cmd.py Tue Oct 18 17:16:00 2011 +0200 +++ b/Lib/cmd.py Tue Oct 18 11:50:40 2011 -0700 @@ -280,10 +280,14 @@ except IndexError: return None + def get_names_filter(self, name): + return ((name.startswith('do_') or name.startswith('help_')) and + not name.endswith('EOF')) + def get_names(self): # This method used to pull in base class attributes # at a time dir() didn't do it yet. - return dir(self.__class__) + return filter(self.get_names_filter, dir(self)) def complete_help(self, *args): commands = set(self.completenames(*args))