Commit bbd45cd01c5993de0970065b2bbd03aa28837b2c
1 parent
8f1db4dc
Clarify qpdf's exit statuses in the documentation
Showing
3 changed files
with
37 additions
and
3 deletions
TODO
| ... | ... | @@ -3,14 +3,13 @@ Candidates for upcoming release |
| 3 | 3 | |
| 4 | 4 | * Trivial fixes: |
| 5 | 5 | * Remove travisci |
| 6 | - * Update manual to clearly state qpdf's exit codes including mention | |
| 7 | - of not exiting with code 1. | |
| 8 | 6 | |
| 9 | 7 | * Quick issues: |
| 10 | 8 | * #438: things written to stdout instead of stderr; --no-warn issues |
| 11 | 9 | * #454: integer overflow |
| 12 | 10 | * #451: BufferInputSource performance enhancement |
| 13 | 11 | * #432: WindowsCryptProvider fixes |
| 12 | + * Add --warning-exit-0 option. Search for --no-warn in the docs. | |
| 14 | 13 | |
| 15 | 14 | * Easy build/test |
| 16 | 15 | * #429: cygwin build and openssl version (see #455) | ... | ... |
manual/qpdf-manual.xml
| ... | ... | @@ -594,6 +594,40 @@ make |
| 594 | 594 | Most options require an output file, but some testing or |
| 595 | 595 | inspection commands do not. These are specifically noted. |
| 596 | 596 | </para> |
| 597 | + <sect2 id="ref.exit-status"> | |
| 598 | + <title>Exit Status</title> | |
| 599 | + <para> | |
| 600 | + The exit status of <command>qpdf</command> may be interpreted as | |
| 601 | + follows: | |
| 602 | + <itemizedlist> | |
| 603 | + <listitem> | |
| 604 | + <para> | |
| 605 | + <literal>0</literal>: no errors or warnings were found. The | |
| 606 | + file may still have problems qpdf can't detect. | |
| 607 | + </para> | |
| 608 | + </listitem> | |
| 609 | + <listitem> | |
| 610 | + <para> | |
| 611 | + <literal>2</literal>: errors were found. qpdf was not able to | |
| 612 | + fully process the file. | |
| 613 | + </para> | |
| 614 | + </listitem> | |
| 615 | + <listitem> | |
| 616 | + <para> | |
| 617 | + <literal>3</literal>: qpdf encountered problems that it was | |
| 618 | + able to recover from. In some cases, the resulting file may | |
| 619 | + still be damaged. Note that qpdf still exits with status | |
| 620 | + <literal>3</literal> if it finds warnings even when | |
| 621 | + <option>--no-warn</option> is specified. | |
| 622 | + </para> | |
| 623 | + </listitem> | |
| 624 | + </itemizedlist> | |
| 625 | + Note that <command>qpdf</command> never exists with status | |
| 626 | + <literal>1</literal>. If you get an exit status of | |
| 627 | + <literal>1</literal>, it was something else, like the shell not | |
| 628 | + being able to find or execute <command>qpdf</command>. | |
| 629 | + </para> | |
| 630 | + </sect2> | |
| 597 | 631 | </sect1> |
| 598 | 632 | <sect1 id="ref.shell-completion"> |
| 599 | 633 | <title>Shell Completion</title> | ... | ... |
qpdf/qpdf.cc
| ... | ... | @@ -1621,7 +1621,8 @@ ArgParser::argHelp() |
| 1621 | 1621 | << "Ordinarily, qpdf exits with a status of 0 on success or a status of 2\n" |
| 1622 | 1622 | << "if any errors occurred. If there were warnings but not errors, qpdf\n" |
| 1623 | 1623 | << "exits with a status of 3. If warnings would have been issued but --no-warn\n" |
| 1624 | - << "was given, an exit status of 3 is still used.\n"; | |
| 1624 | + << "was given, an exit status of 3 is still used. qpdf does not use exit\n" | |
| 1625 | + << "status 1, since that is used by the shell if it can't execute qpdf.\n"; | |
| 1625 | 1626 | } |
| 1626 | 1627 | |
| 1627 | 1628 | void | ... | ... |