Bug 32149 - "pdfinfo -v", "pdfinfo -?", etc. return error status 99
Summary: "pdfinfo -v", "pdfinfo -?", etc. return error status 99
Status: RESOLVED FIXED
Alias: None
Product: poppler
Classification: Unclassified
Component: general (show other bugs)
Version: unspecified
Hardware: All All
: medium trivial
Assignee: poppler-bugs
QA Contact:
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2010-12-06 14:06 UTC by Marcel Stimberg
Modified: 2010-12-12 15:29 UTC (History)
0 users

See Also:
i915 platform:
i915 features:


Attachments
Fixing the error code for help, version, and listenc info (1.73 KB, patch)
2010-12-09 14:14 UTC, Marcel Stimberg
Details | Splinter Review

Description Marcel Stimberg 2010-12-06 14:06:50 UTC
Reported in the Ubuntu bug tracker:

For example "pdfinfo -v" should return the exit status 0 for success, but returns return status 99.

Same with "pdfinfo -h", "pdfinfo -help", "pdfinfo --help", "pdfinfo -?", and "pdfinfo -listenc"
Comment 1 Marcel Stimberg 2010-12-06 14:08:38 UTC
Sorry, forgot the link to the original bug report:
https://bugs.launchpad.net/ubuntu/+source/poppler/+bug/618854
Comment 2 Albert Astals Cid 2010-12-08 12:00:55 UTC
And why is this a bug? This is obviously on purpose.
Comment 3 Marcel Stimberg 2010-12-08 13:11:45 UTC
¿on purpose? pdfinfo -v etc. are perfectly valid calls and should of course return the error code 0, the error code 99 is signalling "other error" according to the man page. I know of no other program returning an error code for successful actions like --help etc.

A quick look at the code shows the reason for the bug: all cases showing the version and/or help information are lumped together. Some of them (invalid options) should return 99, others (asking for the version or help info) should not.
Comment 4 Albert Astals Cid 2010-12-09 11:42:26 UTC
So you already looked at the code :-) What about attaching a patch? I'm busy doing "more important things" at the moment.
Comment 5 Marcel Stimberg 2010-12-09 14:14:21 UTC
Created attachment 40966 [details] [review]
Fixing the error code for help, version, and listenc info

I didn't look at the code before you claimed it to be "on purpose" :-P But here you go, this patch should solve the issue.
Comment 6 Albert Astals Cid 2010-12-12 15:29:39 UTC
Fixed for poppler 0.16.0


Use of freedesktop.org services, including Bugzilla, is subject to our Code of Conduct. How we collect and use information is described in our Privacy Policy.