From d9a1181b7a4fb60c7845aff3135212e5242a813e Mon Sep 17 00:00:00 2001 From: Rob Austein Date: Thu, 4 Mar 2010 19:31:02 +0000 Subject: Checkpoint svn path=/rpkid/rpki/cli.py; revision=3023 --- rpkid/rpki/cli.py | 14 ++++++++++---- 1 file changed, 10 insertions(+), 4 deletions(-) (limited to 'rpkid/rpki/cli.py') diff --git a/rpkid/rpki/cli.py b/rpkid/rpki/cli.py index 4960c387..32844896 100644 --- a/rpkid/rpki/cli.py +++ b/rpkid/rpki/cli.py @@ -28,8 +28,12 @@ except ImportError: class Cmd(cmd.Cmd): + emptyline_repeats_last_command = False + + EOF_exits_command_loop = True + identchars = cmd.IDENTCHARS + "/-." - + histfile = None def __init__(self, argv = None): @@ -40,8 +44,9 @@ class Cmd(cmd.Cmd): self.cmdloop_with_history() def do_EOF(self, arg): - print - return True + if self.EOF_exits_command_loop and self.prompt: + print + return self.EOF_exits_command_loop def do_exit(self, arg): return True @@ -49,7 +54,8 @@ class Cmd(cmd.Cmd): do_quit = do_exit def emptyline(self): - pass + if self.emptyline_repeats_last_command: + cmd.Cmd.emptyline(self) def filename_complete(self, text, line, begidx, endidx): return glob.glob(text + "*") -- cgit v1.2.3