This is not tested, but maybe it'll work :)
def complete(self, text, state):
if text.startswith('config):
return self.config.complete(text, state)
return Cmd.complete(self, text, state)
--
http://mail.python.org/mailman/listinfo/python-list
I have sub-classes of cmd.Cmd in an arrangement somewhat like
class Config(cmd.Cmd):
def do_foo(self, line): print "Fooing %r" % line
def complete_foo(self, text, line, begidx, endidx):
...
class MyTUI(cmd.Cmd):
def __init__(self, configger=Config, *args, **kwargs):
c