Skip to content

Commit f27958c

Browse files
committed
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
1 parent 26fd614 commit f27958c

13 files changed

+13
-14
lines changed

src/main/java/com/adobe/epubcheck/tool/EpubChecker.java

+1-2
Original file line numberDiff line numberDiff line change
@@ -666,8 +666,7 @@ else if ((args.length > (i + 1)) && (args[i + 1].equalsIgnoreCase("-")))
666666
outWriter.setQuiet(true);
667667
break;
668668
case "failonwarnings":
669-
String fw = args[i].substring("--failonwarnings".length());
670-
failOnWarnings = (fw.compareTo("-") != 0);
669+
failOnWarnings = true;
671670
break;
672671
case "r":
673672
case "redir":

src/main/resources/com/adobe/epubcheck/util/messages.properties

+1-1
Original file line numberDiff line numberDiff line change
@@ -87,7 +87,7 @@ help_text = \
8787
-o <file> = same as --out\n\
8888
-x <file> = same as --xmp\n\
8989
-j <file> = same as --json\n\
90-
--failonwarnings[+|-] = By default, the tool returns a 1 if errors are found in the file or 0 if no errors\n\
90+
--failonwarnings = By default, the tool returns a 1 if errors are found in the file or 0 if no errors\n\
9191
\ are found. Using --failonwarnings will cause the process to exit with a status of\n\
9292
\ 1 if either warnings or errors are present and 0 only when there are no errors or warnings.\n\
9393
-q, --quiet = no message on console, except errors, only in the output\n\

src/main/resources/com/adobe/epubcheck/util/messages_da.properties

+1-1
Original file line numberDiff line numberDiff line change
@@ -80,7 +80,7 @@ help_text = EPUBCheck v%1$s\n\n\
8080
-o <file> = synonym for --out\n\
8181
-x <file> = synonym for --xmp\n\
8282
-j <file> = synonym for --json\n\
83-
--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\
83+
--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\
8484
\ Ved brug af --failonwarnings vil EPUBCheck blive klar til afslutning\n\
8585
\ med ExitCode 1 når der er advarsler, og ExitCode 0 ved ingen fejl eller mangler.\n\
8686
-q, --quiet = kun fejl udsendes på konsollen\n\

src/main/resources/com/adobe/epubcheck/util/messages_de.properties

+1-1
Original file line numberDiff line numberDiff line change
@@ -84,7 +84,7 @@ help_text = EPUBCheck v%1$s\n\n\
8484
-o <datei> = Synonym zu --out\n\
8585
-x <datei> = Synonym zu --xmp\n\
8686
-j <datei> = Synonym zu --json\n\
87-
--failonwarnings[+|-] = Standardmäßig wird EPUBCheck mit ExitCode 1 beendet falls Fehler im EPUB gefunden wurden\n\
87+
--failonwarnings = Standardmäßig wird EPUBCheck mit ExitCode 1 beendet falls Fehler im EPUB gefunden wurden\n\
8888
\ und mit ExitCode 0, falls keine Fehler gefunden wurden. Bei Nutzung von --failonwarnings\n\
8989
\ wird EPUBCheck auch bereits bei Auftreten von Warnungen mit ExitCode 1 beendet.\n\
9090
-q, --quiet = Nur Fehler werden auf der Konsole ausgegeben\n\

src/main/resources/com/adobe/epubcheck/util/messages_es.properties

+1-1
Original file line numberDiff line numberDiff line change
@@ -84,7 +84,7 @@ help_text = EPUBCheck v%1$s\n\n\
8484
-o <file> = igual a --out\n\
8585
-x <file> = igual a --xmp\n\
8686
-j <file> = igual a --json\n\
87-
--failonwarnings[+|-] = Por defecto, la herramienta devuelve 1 si se encuentran errores en el archivo o 0 si no hay errores\n\
87+
--failonwarnings = Por defecto, la herramienta devuelve 1 si se encuentran errores en el archivo o 0 si no hay errores\n\
8888
\ Utilizar --failonwarnings provoca la detención del proceso con un resultado\n\
8989
\ de 1 si hay errores o advertencias y 0 cuando no los hay.\n\
9090
-q, --quiet = no hay mensajes en la consola; excepto errores, solo en la salida\n\

src/main/resources/com/adobe/epubcheck/util/messages_fr.properties

+1-1
Original file line numberDiff line numberDiff line change
@@ -84,7 +84,7 @@ help_text = EPUBCheck v%1$s\n\n\
8484
-o <file> = identique à --out\n\
8585
-x <file> = identique à --xmp\n\
8686
-j <file> = identique à --json\n\
87-
--failonwarnings[+|-] = Par défaut, cet outil renvoie 1 si des erreurs sont trouvées ou 0 si le fichier\n\
87+
--failonwarnings = Par défaut, cet outil renvoie 1 si des erreurs sont trouvées ou 0 si le fichier\n\
8888
\ ne contient aucune erreur. En utilisant --failonwarnings, 1 sera renvoyé également\n\
8989
\ si des warnings ou des erreurs sont présents, et 0 ne sera renvoyés que si le fichier\n\
9090
\ ne contient ni erreurs ni warnings.\n\

src/main/resources/com/adobe/epubcheck/util/messages_it.properties

+1-1
Original file line numberDiff line numberDiff line change
@@ -82,7 +82,7 @@ help_text = EPUBCheck v%1$s\n\n\
8282
-o <file> = sinonimo di --out\n\
8383
-x <file> = sinonimo di --xmp\n\
8484
-j <file> = sinonimo di --json\n\
85-
--failonwarnings[+|-] = di norma, ritorna 1 se sono rilevati errori,\n\
85+
--failonwarnings = di norma, ritorna 1 se sono rilevati errori,\n\
8686
\ e 0 altrimenti.\n\
8787
\ Specificando --failonwarnings, sarà ritornato\n\
8888
\ 1 in presenza di errori o potenziali errori\n\

src/main/resources/com/adobe/epubcheck/util/messages_ja.properties

+1-1
Original file line numberDiff line numberDiff line change
@@ -81,7 +81,7 @@ help_text = EPUBCheck v%1$s\n\n\
8181
-o <file> = --out と同様\n\
8282
-x <file> = --xmp と同様\n\
8383
-j <file> = --json と同様\n\
84-
--failonwarnings[+|-] = デフォルトでは、終了ステータスコードとして、エラーが検出されれば1を、検出されなければ\n\
84+
--failonwarnings = デフォルトでは、終了ステータスコードとして、エラーが検出されれば1を、検出されなければ\n\
8585
\ 0を返します. --failonwarnings オプションを指定すると、警告かエラーがあれば1を、警告もエラーもどちらも\n\
8686
\ ない場合のみ0を返すようになります.\n\
8787
-q, --quiet = エラー以外のメッセージをコンソールに出力しないようにします\n\

src/main/resources/com/adobe/epubcheck/util/messages_ko_KR.properties

+1-1
Original file line numberDiff line numberDiff line change
@@ -78,7 +78,7 @@ help_text = EPUBCheck v%1$s\n\n\
7878
-o <file> = --out과 같음\n\
7979
-x <file> = --xmp와 같음\n\
8080
-j <file> = --json과 같음\n\
81-
--failonwarnings[+|-] = 유효성 검사를 완료한 후 오류가 검출되면 1을 오류가 없으면 0을 반환합니다.\n\
81+
--failonwarnings = 유효성 검사를 완료한 후 오류가 검출되면 1을 오류가 없으면 0을 반환합니다.\n\
8282
\ --failonwarnings 옵션을 지정하면 경고 또는 오류가있는 경우 1을 모두 없을 경우에만 0을 반환합니다.\n\
8383
-q, --quiet = 오류를 제외하고 화면에 메시지를 출력하지 않습니다.\n\
8484
-f, --fatal = 심각한 오류 메시지만 출력 파일에 표시합니다.\n\

src/main/resources/com/adobe/epubcheck/util/messages_nl.properties

+1-1
Original file line numberDiff line numberDiff line change
@@ -84,7 +84,7 @@ help_text = EPUBCheck v%1$s\n\n\
8484
-o <file> = gelijk aan --out\n\
8585
-x <file> = gelijk aan --xmp\n\
8686
-j <file> = gelijk aan --json\n\
87-
--failonwarnings[+|-] = standaard geeft het programma een waarde van 1 als er fouten worden gedetecteerd\n\
87+
--failonwarnings = standaard geeft het programma een waarde van 1 als er fouten worden gedetecteerd\n\
8888
\ en een waarde van 0 als alles OK is.\n\
8989
\ Gebruik --failonwarnings als u wilt dat er een waarde van 1 wordt teruggegeven als er fouten \n\
9090
\ OF waarschuwingen worden ontdekt. \n\

src/main/resources/com/adobe/epubcheck/util/messages_pt_BR.properties

+1-1
Original file line numberDiff line numberDiff line change
@@ -81,7 +81,7 @@ help_text = EPUBCheck v%1$s\n\n\
8181
-o <arquivo> = o mesmo que --out\n\
8282
-x <arquivo> = o mesmo que --xmp\n\
8383
-j <arquivo> = o mesmo que --json\n\
84-
--failonwarnings[+|-] = Por padrão, a ferramenta retorna 1 se erros forem encontrados no arquivo ou 0 se não forem\n\
84+
--failonwarnings = Por padrão, a ferramenta retorna 1 se erros forem encontrados no arquivo ou 0 se não forem\n\
8585
\ encontrados erros. Usar --failonwarnings irá fazer com que o processo finalize com o status de\n\
8686
\ 1 se houver tanto advertências como falhas presentes e 0 apenas quando não houver erros nem advertências.\n\
8787
-q, --quiet = nenhuma mensagem no console, exceto erros, apenas na saída\n\

src/main/resources/com/adobe/epubcheck/util/messages_zh_TW.properties

+1-1
Original file line numberDiff line numberDiff line change
@@ -78,7 +78,7 @@ help_text = EPUB檢查器 %1$s版\n\n\
7878
-o <file> = 和 --out 相同\n\
7979
-x <file> = 和 --xmp 相同\n\
8080
-j <file> = 和 --json 相同\n\
81-
--failonwarnings[+|-] = 預設上,當發現錯誤時回報值為 1 或者沒有錯誤時回報值為 0。使用 --failonwarnings 將會使得處理程序終止,狀態為 1 並且有警告訊息或者錯誤需要顯示亦然,而只會在沒有錯誤與警告訊息時才會回傳 0。\n\
81+
--failonwarnings = 預設上,當發現錯誤時回報值為 1 或者沒有錯誤時回報值為 0。使用 --failonwarnings 將會使得處理程序終止,狀態為 1 並且有警告訊息或者錯誤需要顯示亦然,而只會在沒有錯誤與警告訊息時才會回傳 0。\n\
8282
-q, --quiet = 除了錯誤以外不會在終端機上顯示訊息,但僅限於結果\n\
8383
-f, --fatal = 結果僅包含致命錯誤\n\
8484
-e, --error = 結果僅包含錯誤以及致命錯誤\n\

src/test/resources/cli/cli.feature

+1-1
Original file line numberDiff line numberDiff line change
@@ -56,7 +56,7 @@ Feature: EPUBCheck Command Line
5656
-o <file> = same as --out
5757
-x <file> = same as --xmp
5858
-j <file> = same as --json
59-
--failonwarnings[+|-] = By default, the tool returns a 1 if errors are found in the file or 0 if no errors
59+
--failonwarnings = By default, the tool returns a 1 if errors are found in the file or 0 if no errors
6060
are found. Using --failonwarnings will cause the process to exit with a status of
6161
1 if either warnings or errors are present and 0 only when there are no errors or warnings.
6262
-q, --quiet = no message on console, except errors, only in the output

0 commit comments

Comments
 (0)