From 7cd6dab7f01869a3647cc5fe5a30a6d3af0b19da Mon Sep 17 00:00:00 2001 From: Daniel Black Date: Thu, 7 Feb 2013 20:25:59 +1100 Subject: [PATCH] ENH: add help command --- common/protocol.py | 1 + fail2ban-client | 4 +++- 2 files changed, 4 insertions(+), 1 deletion(-) diff --git a/common/protocol.py b/common/protocol.py index 99a2fe09..1083a94b 100644 --- a/common/protocol.py +++ b/common/protocol.py @@ -40,6 +40,7 @@ protocol = [ ["stop", "stops all jails and terminate the server"], ["status", "gets the current status of the server"], ["ping", "tests if the server is alive"], +["help", "return this output"], ['', "LOGGING", ""], ["set loglevel ", "sets logging level to . 0 is minimal, 4 is debug"], ["get loglevel", "gets the logging level"], diff --git a/fail2ban-client b/fail2ban-client index 7ee4a47c..76c18c04 100755 --- a/fail2ban-client +++ b/fail2ban-client @@ -380,7 +380,9 @@ class Fail2banClient: if cmd == "exit" or cmd == "quit": # Exit return True - if not cmd == "": + if cmd == "help": + self.dispUsage() + elif not cmd == "": self.__processCommand(shlex.split(cmd)) except (EOFError, KeyboardInterrupt): print