我使用completedefault(
see the doc)完成Cmd模块.但似乎只有在第一个词之后才会被调用.
def completedefault(self,text,line,begidx,endidx):
print('completedefault is called')
return ['foo','bar']
输出:
(Cmd) f<Tab><Tab>
(Cmd) foo f<Tab><Tab>
completedefault is called
foo bar
如何更改此行为,甚至在第一个单词上调用它?