def complete(self, text, state):
"""Complete current command"""
if len(readline.get_line_buffer().strip()) == 0 or (len(readline.get_line_buffer().split()) <= 1 and readline.get_line_buffer()[-1] != " "):
results = [command + " " for command in self.commands if command.startswith(text) ] + [None]
return results[state]
评论列表
文章目录