diff --git a/fail2ban/client/fail2banregex.py b/fail2ban/client/fail2banregex.py index de2bf05a..f6a4b141 100644 --- a/fail2ban/client/fail2banregex.py +++ b/fail2ban/client/fail2banregex.py @@ -108,7 +108,8 @@ usage = lambda: "%s [OPTIONS] [IGNOREREGEX]" % sys.argv[0] class _f2bOptParser(OptionParser): def format_help(self, *args, **kwargs): """ Overwritten format helper with full ussage.""" - return usage() + __doc__ + """ + self.usage = '' + return "Usage: " + usage() + __doc__ + """ LOG: string a string representing a log line filename path to a log file (/var/log/auth.log) @@ -121,7 +122,7 @@ REGEX: IGNOREREGEX: string a string representing an 'ignoreregex' filename path to a filter file (filter.d/sshd.conf) - """ + OptionParser.format_help(self, *args, **kwargs) + """\n +\n""" + OptionParser.format_help(self, *args, **kwargs) + """\n Report bugs to https://github.com/fail2ban/fail2ban/issues\n """ + __copyright__ + "\n" diff --git a/man/generate-man b/man/generate-man index f7a7836c..538588a9 100755 --- a/man/generate-man +++ b/man/generate-man @@ -3,12 +3,14 @@ set -eu export PYTHONPATH=.. +export PATH="../bin:$PATH" -f2bversion=$(../bin/fail2ban-client --version | head -n1 | sed -e 's,.* v,,g') +f2bversion=$(fail2ban-client -V) +echo "Generating man for $f2bversion ..." # fail2ban-client echo -n "Generating fail2ban-client " -help2man --section=1 --no-info --include=fail2ban-client.h2m --output fail2ban-client.1 ../bin/fail2ban-client +help2man --section=1 --no-info --include=fail2ban-client.h2m --output fail2ban-client.1 fail2ban-client echo "[done]" echo -n "Patching fail2ban-client " # Changes the title. @@ -39,22 +41,22 @@ echo "[done]" # fail2ban-python echo -n "Generating fail2ban-python " -help2man --version-string=f2bversion --section=1 --no-info --include=fail2ban-python.h2m --output fail2ban-python.1 ../bin/fail2ban-python +help2man --version-string=$f2bversion --section=1 --no-info --include=fail2ban-python.h2m --output fail2ban-python.1 fail2ban-python echo "[done]" # fail2ban-server echo -n "Generating fail2ban-server " -help2man --section=1 --no-info --include=fail2ban-server.h2m --output fail2ban-server.1 ../bin/fail2ban-server +help2man --section=1 --no-info --include=fail2ban-server.h2m --output fail2ban-server.1 fail2ban-server echo "[done]" # fail2ban-testcases echo -n "Generating fail2ban-testcases " -help2man --section=1 --no-info --include=fail2ban-testcases.h2m --output fail2ban-testcases.1 ../bin/fail2ban-testcases +help2man --section=1 --no-info --include=fail2ban-testcases.h2m --output fail2ban-testcases.1 fail2ban-testcases echo "[done]" # fail2ban-regex echo -n "Generating fail2ban-regex " -help2man --section=1 --no-info --include=fail2ban-regex.h2m --output fail2ban-regex.1 ../bin/fail2ban-regex +help2man --section=1 --no-info --include=fail2ban-regex.h2m --output fail2ban-regex.1 fail2ban-regex echo "[done]" echo -n "Patching fail2ban-regex " # Changes the title.