Follow-up Comment #30, bug #67612 (group groff): [comment #29 comment #29:] > Huh, I got so swept up in coding style details I failed to notice the content > issues in the man page's -W description. > * The patch should generalize from "if font embedding fails" to something > like "if gropdf emits any warnings" (per comment #21). > * I'd also suggest clarifying or removing "Normally, gropdf issues a warning > diagnostic and proceeds." As far as I can tell, -W won't make gropdf exit > any earlier, just with different status.
Good points, both.
Patch v3:
$ git diff
diff --git a/src/devices/gropdf/gropdf.1.man
b/src/devices/gropdf/gropdf.1.man
index 09b5d191a..87ccd025c 100644
--- a/src/devices/gropdf/gropdf.1.man
+++ b/src/devices/gropdf/gropdf.1.man
@@ -316,11 +316,7 @@ .SH Options
.
.TP
.B \-W
-Exit with failure status if font embedding fails.
-.
-Normally,
-.I gropdf
-issues a warning diagnostic and proceeds.
+Exit with failure status if any warnings are issued.
.
.
.\" .TP
@@ -1944,17 +1940,19 @@ .SH "Exit status"
.IP 0
.I gropdf
successfully produced a PDF document.
+.
+.
.IP 1
.I gropdf
experienced a critical error,
-or could not interpret its arguments.
-No PDF was produced,
-or the document produced will be unusable.
+or warnings were emitted and the
+.B \-W
+option was specified.
+.
+.
.IP 2
.I gropdf
-emitted warnings.
-The document produced may be usable,
-but may fail to render as desired.
+could not interpret its command-line arguments.
.
.
.br
diff --git a/src/devices/gropdf/gropdf.pl b/src/devices/gropdf/gropdf.pl
index d0da52c42..db0562c9c 100644
--- a/src/devices/gropdf/gropdf.pl
+++ b/src/devices/gropdf/gropdf.pl
@@ -461,7 +461,7 @@ sub usage
"Translate the output of troff(1) into Portable Document Format.\n" .
"See the gropdf(1) manual page.\n";
}
- exit($had_error);
+ exit($had_error ? 2 : 0);
}
my $fd;
@@ -498,7 +498,7 @@ if (!GetOptions('F=s' => \@fdlist, 'I=s' => \@idirs, 'l'
=> \$frot,
'e' => \$embedall, 'y=s' => \$Foundry, 's' => \$stats, 'W' =>
\$warnexit,
'u:s' => \$unicodemap))
{
- &usage(1);
+ &usage(1); # had error
}
unshift(@idirs,'.');
@@ -3197,7 +3197,7 @@ sub Warn
unshift(@_, "warning: ");
my $msg=join('',@_);
Msg(0,$msg);
- $xitcd=2 if $warnexit;
+ $xitcd=1 if $warnexit;
}
sub Die
_______________________________________________________
Reply to this item at:
<https://savannah.gnu.org/bugs/?67612>
_______________________________________________
Message sent via Savannah
https://savannah.gnu.org/
signature.asc
Description: PGP signature
