mirror of
https://frontier.innolan.net/rainlance/amiga-tz.git
synced 2025-11-21 20:34:27 +00:00
--help and --version work
SCCS-file: zdump.c SCCS-SID: 8.7
This commit is contained in:
committed by
Paul Eggert
parent
e789071cd8
commit
b5f59735d4
18
zdump.c
18
zdump.c
@ -230,6 +230,17 @@ const char * const zone;
|
||||
warned = TRUE;
|
||||
}
|
||||
|
||||
static void
|
||||
usage(const char *progname, FILE *stream, int status)
|
||||
{
|
||||
(void) fprintf(stream,
|
||||
_("%s: usage is %s [ --version ] [ --help ] [ -v ] [ -c [loyear,]hiyear ] zonename ...\n\
|
||||
\n\
|
||||
Report bugs to tz@elsie.nci.nih.gov.\n"),
|
||||
progname, progname);
|
||||
exit(status);
|
||||
}
|
||||
|
||||
int
|
||||
main(argc, argv)
|
||||
int argc;
|
||||
@ -266,6 +277,8 @@ char * argv[];
|
||||
if (strcmp(argv[i], "--version") == 0) {
|
||||
(void) printf("%s\n", elsieid);
|
||||
exit(EXIT_SUCCESS);
|
||||
} else if (strcmp(argv[i], "--help") == 0) {
|
||||
usage(progname, stdout, EXIT_SUCCESS);
|
||||
}
|
||||
vflag = 0;
|
||||
cutarg = NULL;
|
||||
@ -275,10 +288,7 @@ char * argv[];
|
||||
else cutarg = optarg;
|
||||
if ((c != EOF && c != -1) ||
|
||||
(optind == argc - 1 && strcmp(argv[optind], "=") == 0)) {
|
||||
(void) fprintf(stderr,
|
||||
_("%s: usage is %s [ --version ] [ -v ] [ -c [loyear,]hiyear ] zonename ...\n"),
|
||||
progname, progname);
|
||||
exit(EXIT_FAILURE);
|
||||
usage(progname, stderr, EXIT_FAILURE);
|
||||
}
|
||||
if (vflag) {
|
||||
if (cutarg != NULL) {
|
||||
|
||||
Reference in New Issue
Block a user