def complete(self, text, state):
        "Generic readline completion entry point."

        # dexnet entity tab completion
        results = [w for w in self.words if w.startswith(text)] + [None]
        if results != [None]:
            return results[state]

        buffer = readline.get_line_buffer()
        line = readline.get_line_buffer().split()

        # dexnet entity tab completion
        results =  [w for w in self.words if w.startswith(text)] + [None]
        if results != [None]:
            return results[state]

        # account for last argument ending in a space
        if RE_SPACE.match(buffer):
            line.append('')

        return (self.complete_extra(line) + [None])[state]
Generic readline completion entry point.