Prompt user on quit.
This commit is contained in:
parent
0742bc4fd0
commit
091db9cdf2
|
@ -1076,7 +1076,15 @@ class ConsoleMaster(controller.Master):
|
|||
if self.nested:
|
||||
self.view_connlist()
|
||||
else:
|
||||
raise Stop
|
||||
self.prompt_onekey(
|
||||
"Quit",
|
||||
(
|
||||
("yes", "y"),
|
||||
("no", "n"),
|
||||
),
|
||||
self.quit,
|
||||
)
|
||||
k = None
|
||||
elif k == "S":
|
||||
self.path_prompt("Save flows: ", self.save_flows)
|
||||
k = None
|
||||
|
@ -1091,6 +1099,10 @@ class ConsoleMaster(controller.Master):
|
|||
except (Stop, KeyboardInterrupt):
|
||||
pass
|
||||
|
||||
def quit(self, a):
|
||||
if a != "n":
|
||||
raise Stop
|
||||
|
||||
def shutdown(self):
|
||||
for i in self.state.flow_list:
|
||||
i.kill()
|
||||
|
|
Loading…
Reference in New Issue