def init_history(self, histfile):
#readline.parse_and_bind("bind ^I rl_complete")
# Register our completer function
readline.set_completer(SimpleCompleter(G.cmmands.keys()).complete)
#readline.set_completer(TabCompleter().complete)
### Add autocompletion
if 'libedit' in readline.__doc__:
readline.parse_and_bind("bind -e")
readline.parse_and_bind("bind '\t' rl_complete")
else:
readline.parse_and_bind("tab: complete")
# Use the tab key for completion
#readline.parse_and_bind('tab: complete')
if hasattr(readline, "read_history_file"):
try:
readline.read_history_file(histfile)
except:
pass
atexit.register(self.save_history, histfile)
评论列表
文章目录