Skip to content

Commit

Permalink
Cleanly exit from a Ctrl-C and add 'q'/'quit' commands
Browse files Browse the repository at this point in the history
  • Loading branch information
phrohdoh committed Aug 9, 2015
1 parent 96e1da6 commit 586a00b
Showing 1 changed file with 10 additions and 1 deletion.
11 changes: 10 additions & 1 deletion browse_slp.py
Original file line number Diff line number Diff line change
Expand Up @@ -262,6 +262,12 @@ def __init__(self, loader):

self.loader = loader

def do_q(self, params):
sys.exit(0)

def do_quit(self, params):
self.do_q(params)

def do_drs(self, filename):
"""
Load a specified DRS file.
Expand Down Expand Up @@ -445,4 +451,7 @@ def do_saveall(self, params):
for command in args.commands:
browser.onecmd(command)
if not args.batch_mode:
browser.cmdloop()
try:
browser.cmdloop()
except KeyboardInterrupt:
sys.exit(0)

0 comments on commit 586a00b

Please sign in to comment.