diff --git a/protocol.py b/protocol.py index daf36e6d..8985edc0 100644 --- a/protocol.py +++ b/protocol.py @@ -30,23 +30,33 @@ import textwrap # Describes the protocol used to communicate with the server. protocol = [ -["start", "starts the server and the jails"], -["reload", "reloads the configuration"], -["stop", "stops all jails and terminate the server"], -["status", "gets the current status of the server"], -["ping", "tests if the server is alive"], -['', ''], -["set loglevel ", "sets logging level to "], -["get loglevel", "gets the logging level"], -["set logtarget ", "sets logging target to "], -["get logtarget", "gets logging target"], -['', ''], -["add ", "creates using "], -["set ", "sets the value for "], -["get ", "gets the value for "], -['', ''], -["start ", "starts "], -["stop ", "stops . The jail is removed"], +["start", "starts the server and the jails"], +["reload", "reloads the configuration"], +["stop", "stops all jails and terminate the server"], +["status", "gets the current status of the server"], +["ping", "tests if the server is alive"], +['', ''], +["set loglevel ", "sets logging level to "], +["get loglevel", "gets the logging level"], +["set logtarget ", "sets logging target to "], +["get logtarget", "gets logging target"], +['', ''], +["add ", "creates using "], +['', ''], +["set idle on|off", "sets the idle state of "], +["set addignoreip ", "adds to the ignore list of "], +["set delignoreip ", "removes from the ignore list of "], +["set addlogpath ", "adds to the monitoring list of "], +["set dellogpath ", "removes to the monitoring list of "], +["set timeregex ", "sets the regular expression to match the date format for "], +["set timepattern ", "sets the pattern to match the date format for "], +["set failregex ", "sets the regular expression which must match failures for "], +["set ignoreregex ", "sets the regular expression which should match pattern to exclude for "], +['', ''], +["get ", "gets the value for "], +['', ''], +["start ", "starts "], +["stop ", "stops . The jail is removed"], ["status ", "gets the current status of "] ] @@ -56,11 +66,16 @@ protocol = [ def printFormatted(): INDENT=4 - FIRST=30 - WIDTH=75 - for command in [' ' * INDENT + m[0] + - "\n".join(textwrap.wrap(m[1], WIDTH - INDENT, - initial_indent=' ' * (FIRST - len(m[0])), - subsequent_indent=' ' * (FIRST + INDENT))) - for m in protocol]: - print command + MARGIN=35 + WIDTH=40 + for m in protocol: + if m[0] == '': + print + first = True + for n in textwrap.wrap(m[1], WIDTH): + if first: + n = ' ' * INDENT + m[0] + ' ' * (MARGIN - len(m[0])) + n + first = False + else: + n = ' ' * (INDENT + MARGIN) + n + print n