Bug 2190 - tools should have consistent behavior for help (-h) cases
: tools should have consistent behavior for help (-h) cases
Status: RESOLVED LATER
: libtiff
default
: 3.9.0
: All All
: P2 enhancement
: ---
Assigned To:
:
:
: migrated_to_gitlab
:
:
  Show dependency treegraph
 
Reported: 2010-05-03 11:13 by
Modified: 2019-10-01 14:19 (History)


Attachments


Note

You need to log in before you can comment on or make changes to this bug.


Description From 2010-05-03 11:13:46
The various executables included in libtiff don't follow established
convention, and aren't even consistent among themselves, with respect to
emitting usage messages.  I believe that best practice for command line
programs is considered to be:

1. If the usage message is in response to incorrect command-line parameters,
print it on stderr and exit(1).

2. If the usage message is being printed in response to -h, --help, etc, print
it on stdout and exit(0).

(Support for this position can be found in the GNU coding standards, for
example.)  The tiff tools uniformly fail to print to stdout for -h, and they're
inconsistent about the exit code --- some get it right, most don't.  Quite a
few exit(-1), which I don't think even has portable results.

While I'm griping, I'd suggest dropping the setbuf() calls found in many of the
usage() routines.  I don't see that that helps to do anything except decrease
portability.  It's certainly not useful from a performance standpoint.
------- Comment #1 From 2019-10-01 14:19:23 -------
Bugzilla is no longer used for tracking libtiff issues. Remaining open tickets,
such as this one, have been migrated to the libtiff GitLab instance at
https://gitlab.com/libtiff/libtiff/issues .

The migrated tickets have their summary prefixed with [BZ#XXXX] where XXXX is
the initial Bugzilla issue number.