Repository: w3c/epubcheck (java)

Issue:
epubcheck 5.1.0 does not recognize `--failonwarnings+`, nor `--failonwarnings-`
According to [the help message](https://github.com/w3c/epubcheck/blob/v5.1.0/src/main/resources/com/adobe/epubcheck/util/messages.properties#L90-L92), both `--failonwarnings+` and `--failonwarnings-` should be valid.
But epubcheck 5.1.0 says about them, respectively:
```
Unrecognized argument: "--failonwarnings+"
EPUBCheck v5.1.0
...
```
and
```
Unrecognized argument: "--failonwarnings-"
EPUBCheck v5.1.0
...
```
respectively.


Pull request description:
fix: simplify `--failonwarnings` documentation
The help text presented option `--failonwarnings` as if it also allowed values `--failonwarnings+` and `--failonwarnings-` to respectively enable and disable warning messages.

The CLI implementation did not recognize these options. In addition, the single option `--failonwarnings` is sufficient, since the default behavior is to not return an error code when warnings are reported.

This commit fixes the CLI help text, and tweak the implementation to remove traces of the legacy `--failonwarnings+` and `--failonwarnings-` options.

Fixes #1575

Patch:
diff --git a/src/main/java/com/adobe/epubcheck/tool/EpubChecker.java b/src/main/java/com/adobe/epubcheck/tool/EpubChecker.java
index be0ebf7a..f5e1d45c 100644
--- a/src/main/java/com/adobe/epubcheck/tool/EpubChecker.java
+++ b/src/main/java/com/adobe/epubcheck/tool/EpubChecker.java
@@ -666,8 +666,7 @@ public class EpubChecker
               outWriter.setQuiet(true);
             break;
           case "failonwarnings":
-              String fw = args[i].substring("--failonwarnings".length());
-              failOnWarnings = (fw.compareTo("-") != 0);
+              failOnWarnings = true;
             break;
           case "r":
           case "redir":
diff --git a/src/main/resources/com/adobe/epubcheck/util/messages.properties b/src/main/resources/com/adobe/epubcheck/util/messages.properties
index 14e86762..735c5e92 100644
--- a/src/main/resources/com/adobe/epubcheck/util/messages.properties
+++ b/src/main/resources/com/adobe/epubcheck/util/messages.properties
@@ -87,7 +87,7 @@ help_text = \
           -o <file>                = same as --out\n\
           -x <file>                = same as --xmp\n\
           -j <file>                = same as --json\n\
-          --failonwarnings[+|-]    = By default, the tool returns a 1 if errors are found in the file or 0 if no errors\n\
+          --failonwarnings         = By default, the tool returns a 1 if errors are found in the file or 0 if no errors\n\
           \                           are found.  Using --failonwarnings will cause the process to exit with a status of\n\
           \                           1 if either warnings or errors are present and 0 only when there are no errors or warnings.\n\
           -q, --quiet              = no message on console, except errors, only in the output\n\
diff --git a/src/main/resources/com/adobe/epubcheck/util/messages_da.properties b/src/main/resources/com/adobe/epubcheck/util/messages_da.properties
index 367c6b36..b0a59846 100644
--- a/src/main/resources/com/adobe/epubcheck/util/messages_da.properties
+++ b/src/main/resources/com/adobe/epubcheck/util/messages_da.properties
@@ -80,7 +80,7 @@ help_text = EPUBCheck v%1$s\n\n\
           -o <file>                = synonym for --out\n\
           -x <file>                = synonym for --xmp\n\
           -j <file>                = synonym for --json\n\
-          --failonwarnings[+|-]    = som standard afsluttes EPUBCheck med ExitCode 1 hvis der blev fundet fejl i filen, og med ExitCode 0 hvis der ikke blev fundet fejl.\n\
+          --failonwarnings         = som standard afsluttes EPUBCheck med ExitCode 1 hvis der blev fundet fejl i filen, og med ExitCode 0 hvis der ikke blev fundet fejl.\n\
           \                           Ved brug af --failonwarnings vil EPUBCheck blive klar til afslutning\n\
           \                           med ExitCode 1 når der er advarsler, og ExitCode 0 ved ingen fejl eller mangler.\n\
           -q, --quiet              = kun fejl udsendes på konsollen\n\
diff --git a/src/main/resources/com/adobe/epubcheck/util/messages_de.properties b/src/main/resources/com/adobe/epubcheck/util/messages_de.properties
index 843cadbf..a4658e4b 100644
--- a/src/main/resources/com/adobe/epubcheck/util/messages_de.properties
+++ b/src/main/resources/com/adobe/epubcheck/util/messages_de.properties
@@ -84,7 +84,7 @@ help_text = EPUBCheck v%1$s\n\n\
           -o <datei>              = Synonym zu --out\n\
           -x <datei>              = Synonym zu --xmp\n\
           -j <datei>              = Synonym zu --json\n\
-          --failonwarnings[+|-]   = Standardmäßig wird EPUBCheck mit ExitCode 1 beendet falls Fehler im EPUB gefunden wurden\n\
+          --failonwarnings        = Standardmäßig wird EPUBCheck mit ExitCode 1 beendet falls Fehler im EPUB gefunden wurden\n\
           \                          und mit ExitCode 0, falls keine Fehler gefunden wurden. Bei Nutzung von --failonwarnings\n\
           \                          wird EPUBCheck auch bereits bei Auftreten von Warnungen mit ExitCode 1 beendet.\n\
           -q, --quiet             = Nur Fehler werden auf der Konsole ausgegeben\n\
diff --git a/src/main/resources/com/adobe/epubcheck/util/messages_es.properties b/src/main/resources/com/adobe/epubcheck/util/messages_es.properties
index 903dc1c3..06d3317b 100644
--- a/src/main/resources/com/adobe/epubcheck/util/messages_es.properties
+++ b/src/main/resources/com/adobe/epubcheck/util/messages_es.properties
@@ -84,7 +84,7 @@ help_text = EPUBCheck v%1$s\n\n\
           -o <file>                = igual a --out\n\
           -x <file>                = igual a --xmp\n\
           -j <file>                = igual a --json\n\
-          --failonwarnings[+|-]    = Por defecto, la herramienta devuelve 1 si se encuentran errores en el archivo o 0 si no hay errores\n\
+          --failonwarnings         = Por defecto, la herramienta devuelve 1 si se encuentran errores en el archivo o 0 si no hay errores\n\
           \                           Utilizar --failonwarnings provoca la detención del proceso con un resultado\n\
           \                           de 1 si hay errores o advertencias y 0 cuando no los hay.\n\
           -q, --quiet              = no hay mensajes en la consola; excepto errores, solo en la salida\n\
diff --git a/src/main/resources/com/adobe/epubcheck/util/messages_fr.properties b/src/main/resources/com/adobe/epubcheck/util/messages_fr.properties
index d4a4b2c5..5d3b69fe 100644
--- a/src/main/resources/com/adobe/epubcheck/util/messages_fr.properties
+++ b/src/main/resources/com/adobe/epubcheck/util/messages_fr.properties
@@ -84,7 +84,7 @@ help_text = EPUBCheck v%1$s\n\n\
           -o <file>               = identique à --out\n\
           -x <file>               = identique à --xmp\n\
           -j <file>               = identique à --json\n\
-          --failonwarnings[+|-]   = Par défaut, cet outil renvoie 1 si des erreurs sont trouvées ou 0 si le fichier\n\
+          --failonwarnings        = Par défaut, cet outil renvoie 1 si des erreurs sont trouvées ou 0 si le fichier\n\
           \                          ne contient aucune erreur. En utilisant --failonwarnings, 1 sera renvoyé également\n\
           \                          si des warnings ou des erreurs sont présents, et 0 ne sera renvoyés que si le fichier\n\
           \                          ne contient ni erreurs ni warnings.\n\
diff --git a/src/main/resources/com/adobe/epubcheck/util/messages_it.properties b/src/main/resources/com/adobe/epubcheck/util/messages_it.properties
index c44c56bd..67264dbd 100644
--- a/src/main/resources/com/adobe/epubcheck/util/messages_it.properties
+++ b/src/main/resources/com/adobe/epubcheck/util/messages_it.properties
@@ -82,7 +82,7 @@ help_text = EPUBCheck v%1$s\n\n\
           -o <file>               = sinonimo di --out\n\
           -x <file>               = sinonimo di --xmp\n\
           -j <file>               = sinonimo di --json\n\
-          --failonwarnings[+|-]   = di norma, ritorna 1 se sono rilevati errori,\n\
+          --failonwarnings        = di norma, ritorna 1 se sono rilevati errori,\n\
           \                          e 0 altrimenti.\n\
           \                          Specificando --failonwarnings, sarà ritornato\n\
           \                          1 in presenza di errori o potenziali errori\n\
diff --git a/src/main/resources/com/adobe/epubcheck/util/messages_ja.properties b/src/main/resources/com/adobe/epubcheck/util/messages_ja.properties
index 4c28d05e..bb7cf795 100644
--- a/src/main/resources/com/adobe/epubcheck/util/messages_ja.properties
+++ b/src/main/resources/com/adobe/epubcheck/util/messages_ja.properties
@@ -81,7 +81,7 @@ help_text = EPUBCheck v%1$s\n\n\
           -o <file>                = --out と同様\n\
           -x <file>                = --xmp と同様\n\
           -j <file>                = --json と同様\n\
-          --failonwarnings[+|-]    = デフォルトでは、終了ステータスコードとして、エラーが検出されれば1を、検出されなければ\n\
+          --failonwarnings         = デフォルトでは、終了ステータスコードとして、エラーが検出されれば1を、検出されなければ\n\
           \                           0を返します. --failonwarnings オプションを指定すると、警告かエラーがあれば1を、警告もエラーもどちらも\n\
           \                           ない場合のみ0を返すようになります.\n\
           -q, --quiet              = エラー以外のメッセージをコンソールに出力しないようにします\n\
diff --git a/src/main/resources/com/adobe/epubcheck/util/messages_ko_KR.properties b/src/main/resources/com/adobe/epubcheck/util/messages_ko_KR.properties
index 666bf3d2..b2f105c5 100644
--- a/src/main/resources/com/adobe/epubcheck/util/messages_ko_KR.properties
+++ b/src/main/resources/com/adobe/epubcheck/util/messages_ko_KR.properties
@@ -78,7 +78,7 @@ help_text = EPUBCheck v%1$s\n\n\
           -o <file>                = --out과 같음\n\
           -x <file>                = --xmp와 같음\n\
           -j <file>                = --json과 같음\n\
-          --failonwarnings[+|-]    = 유효성 검사를 완료한 후 오류가 검출되면 1을 오류가 없으면 0을 반환합니다.\n\
+          --failonwarnings         = 유효성 검사를 완료한 후 오류가 검출되면 1을 오류가 없으면 0을 반환합니다.\n\
           \                           --failonwarnings 옵션을 지정하면 경고 또는 오류가있는 경우 1을 모두 없을 경우에만 0을 반환합니다.\n\
           -q, --quiet              = 오류를 제외하고 화면에 메시지를 출력하지 않습니다.\n\
           -f, --fatal              = 심각한 오류 메시지만 출력 파일에 표시합니다.\n\
diff --git a/src/main/resources/com/adobe/epubcheck/util/messages_nl.properties b/src/main/resources/com/adobe/epubcheck/util/messages_nl.properties
index 888e1a30..c71a9dd3 100644
--- a/src/main/resources/com/adobe/epubcheck/util/messages_nl.properties
+++ b/src/main/resources/com/adobe/epubcheck/util/messages_nl.properties
@@ -84,7 +84,7 @@ help_text = EPUBCheck v%1$s\n\n\
           -o <file>               = gelijk aan --out\n\
           -x <file>               = gelijk aan --xmp\n\
           -j <file>               = gelijk aan --json\n\
-          --failonwarnings[+|-]   = standaard geeft het programma een waarde van 1 als er fouten worden gedetecteerd\n\
+          --failonwarnings        = standaard geeft het programma een waarde van 1 als er fouten worden gedetecteerd\n\
           \                          en een waarde van 0 als alles OK is.\n\
           \                          Gebruik --failonwarnings als u wilt dat er een waarde van 1 wordt teruggegeven als er fouten \n\
           \                          OF waarschuwingen worden ontdekt. \n\
diff --git a/src/main/resources/com/adobe/epubcheck/util/messages_pt_BR.properties b/src/main/resources/com/adobe/epubcheck/util/messages_pt_BR.properties
index 1fd1ae3c..e6415583 100644
--- a/src/main/resources/com/adobe/epubcheck/util/messages_pt_BR.properties
+++ b/src/main/resources/com/adobe/epubcheck/util/messages_pt_BR.properties
@@ -81,7 +81,7 @@ help_text = EPUBCheck v%1$s\n\n\
           -o <arquivo>            = o mesmo que --out\n\
           -x <arquivo>            = o mesmo que --xmp\n\
           -j <arquivo>            = o mesmo que --json\n\
-          --failonwarnings[+|-]   = Por padrão, a ferramenta retorna 1 se erros forem encontrados no arquivo ou 0 se não forem\n\
+          --failonwarnings        = Por padrão, a ferramenta retorna 1 se erros forem encontrados no arquivo ou 0 se não forem\n\
           \                          encontrados erros.  Usar --failonwarnings irá fazer com que o processo finalize com o status de\n\
           \                          1 se houver tanto advertências como falhas presentes e 0 apenas quando não houver erros nem advertências.\n\
           -q, --quiet             = nenhuma mensagem no console, exceto erros, apenas na saída\n\
diff --git a/src/main/resources/com/adobe/epubcheck/util/messages_zh_TW.properties b/src/main/resources/com/adobe/epubcheck/util/messages_zh_TW.properties
index f254e695..84ef79b4 100644
--- a/src/main/resources/com/adobe/epubcheck/util/messages_zh_TW.properties
+++ b/src/main/resources/com/adobe/epubcheck/util/messages_zh_TW.properties
@@ -78,7 +78,7 @@ help_text = EPUB檢查器 %1$s版\n\n\
           -o <file> = 和 --out 相同\n\
           -x <file> = 和 --xmp 相同\n\
           -j <file> = 和 --json 相同\n\
-          --failonwarnings[+|-] = 預設上，當發現錯誤時回報值為 1 或者沒有錯誤時回報值為 0。使用 --failonwarnings 將會使得處理程序終止，狀態為 1 並且有警告訊息或者錯誤需要顯示亦然，而只會在沒有錯誤與警告訊息時才會回傳 0。\n\
+          --failonwarnings      = 預設上，當發現錯誤時回報值為 1 或者沒有錯誤時回報值為 0。使用 --failonwarnings 將會使得處理程序終止，狀態為 1 並且有警告訊息或者錯誤需要顯示亦然，而只會在沒有錯誤與警告訊息時才會回傳 0。\n\
           -q, --quiet = 除了錯誤以外不會在終端機上顯示訊息，但僅限於結果\n\
           -f, --fatal = 結果僅包含致命錯誤\n\
           -e, --error = 結果僅包含錯誤以及致命錯誤\n\


Test patch:
diff --git a/src/test/resources/cli/cli.feature b/src/test/resources/cli/cli.feature
index 29c528e9..86b53ab2 100644
--- a/src/test/resources/cli/cli.feature
+++ b/src/test/resources/cli/cli.feature
@@ -56,7 +56,7 @@ Feature: EPUBCheck Command Line
 				-o <file>                = same as --out
 				-x <file>                = same as --xmp
 				-j <file>                = same as --json
-				--failonwarnings[+|-]    = By default, the tool returns a 1 if errors are found in the file or 0 if no errors
+				--failonwarnings         = By default, the tool returns a 1 if errors are found in the file or 0 if no errors
 				                           are found.  Using --failonwarnings will cause the process to exit with a status of
 				                           1 if either warnings or errors are present and 0 only when there are no errors or warnings.
 				-q, --quiet              = no message on console, except errors, only in the output