'help [command]: List commands, or show help on the given command'

def do_help(self, command=None):

    if command:
        self.sendLine(getattr(self, ('do_' + command)).__doc__)
    else:
        commands = [cmd[3:] for cmd in dir(self) if cmd.startswith('do_')]
        self.sendLine(('Valid    commands:    ' + '    '.join(commands)))
