Make all programs support --version

This commit is contained in:
Dianne Skoll
2026-02-05 22:25:10 -05:00
parent 2003c7a703
commit 7841077fc6
3 changed files with 20 additions and 0 deletions

View File

@@ -21,6 +21,9 @@ render characters outside the ASCII character set, see
.SH OPTIONS
.TP
.B \-\-version
Print the version of \fBrem2ps\fR and exit.
.TP
.B \-v
Be more verbose. This causes \fBrem2ps\fR to print progress messages
to the standard error stream. Normally, it is silent.

View File

@@ -628,6 +628,14 @@ to print per page; it is an integer that can range from 1 to 4.
Print (on STDERR) the name of the month and year for each month that
is rendered.
=item --version
Print the version of rem2pdf and exit.
=item --help
Print a brief summary of rem2pdf usage.
=back
=head1 USAGE

View File

@@ -985,6 +985,14 @@ static void Init(int argc, char const *argv[])
case 'e': FillPage = 1; break;
case '-':
if (!strcmp(s, "version")) {
printf("rem2ps version %s\n", VERSION);
exit(0);
}
Usage("Unrecognized option");
break;
default: Usage("Unrecognized option");
}
}
@@ -1016,6 +1024,7 @@ void Usage(char const *s)
fprintf(stderr, "-e Make calendar fill entire page\n");
fprintf(stderr, "-x Put day numbers on left instead of right\n");
fprintf(stderr, "-o[lrtb] marg Specify left, right, top and bottom margins\n");
fprintf(stderr, "--version Print the version of rem2pdf and exit\n");
exit(EXIT_FAILURE);
}