Follow-up Comment #7, bug #67612 (group groff):
[comment #5 comment #5:]
> $ echo 'Yo!' | groff -Tpdf -P--pdfver=1.5 > /dev/null
> gropdf: warning: Only pdf versions 1.4 or 1.7 are supported, not '1.5'
> $ echo $?
> 4
Is use of exit status 4 necessary? Is _gropdf_ already using status 3 for
something?
Conventionally, in _groff_, we assign exit statuses of low value meanings in
alignment with common practice.
0: success
1: false; expected failure; unable to perform desired operation
2: usage error
_groff_, the program, also relies upon this convention because it assumes the
programs it assembles into a pipeline (including output drivers like _gropdf_)
will use at most the two lowest-order bits of the exit status to communicate
information.
_groff_(1):
Exit status
groff exits successfully (with status 0) if either of the options
-h or --help is specified, status 2 if the program cannot interpret
its command‐line arguments, and status 1 if it encounters an error
during operation. Otherwise, groff runs a pipeline to process its
input; if all commands within the pipeline exit successfully, groff
does likewise. If not, groff’s exit status encodes a summary of
problems encountered, setting bit 2 if a command exited with a
failure status, bit 3 if a command was terminated with a signal,
and bit 4 if a command could not be executed. (Thus, if all three
misfortunes befall one’s pipeline, groff exits with status 2^2 +
2^3 + 2^4 = 4+8+16 = 28.) To troubleshoot pipeline problems, re‐
run the groff command with the -V option and break the reported
pipeline down into separate stages, inspecting the exit status of,
and diagnostic messages emitted by, each command.
_______________________________________________________
Reply to this item at:
<https://savannah.gnu.org/bugs/?67612>
_______________________________________________
Message sent via Savannah
https://savannah.gnu.org/
signature.asc
Description: PGP signature
