def run(self):
try:
print("Welcome to ush-{}. Type 'help' for help. ^D to exit".format(VERSION))
while True:
line = Ush.prompt().strip()
if line:
tokens = line.split()
cmd = tokens[0]
if cmd in self._handlers:
handler = self._handlers[cmd]
try:
handler.handle_command(tokens[1:])
except Exception as e:
sys.print_exception(e)
else:
print("Unknown command: {}".format(cmd))
except Exception as e:
print(e)
评论列表
文章目录