Also mention the option in usage() and manual pages.
Signed-off-by: Sami Kerola <kerolasa@iki.fi>
`COPYING' that comes with the Anacron source distribution.
*/
+#include "config.h"
#include <time.h>
#include <sys/time.h>
static void
print_version(void)
{
- printf("Anacron \n"
+ printf("Anacron from project %s\n"
"Copyright (C) 1998 Itai Tzur <itzur@actcom.co.il>\n"
"Copyright (C) 1999 Sean 'Shaleh' Perry <shaleh@debian.org>\n"
"Copyright (C) 2004 Pascal Hakim <pasc@redellipse.net>\n"
"\n"
"Mail comments, suggestions and bug reports to <pasc@redellipse.net>."
- "\n\n");
+ "\n\n", PACKAGE_STRING);
}
static void
.B crond
.B -x
.RB [ext,sch,proc,pars,load,misc,test,bit]
+.br
+.B crond
+.B -V
.SH DESCRIPTION
.I Cron
is started from
.TP
.B "\-x"
This option allows you to set debug flags.
+.TP
+.B "\-V"
+Print version and exit.
.SH SIGNALS
When the
.I SIGHUP
.SH SYNOPSIS
.TP 9
.B cronnext
-[-i users] [-e users] [-s] [-t time] [-v] [-h]
+[-i users] [-e users] [-s] [-t time] [-v] [-h] [-V]
.SH DESCRIPTION
Determine the time cron will execute the next job.
Without arguments, it prints that time considering all crontabs,
.TP
-h
summary of options
+.TP
+-V
+Print version and exit.
.SH AUTHOR
Marco Migliori <sgerwk@aol.com>
.SH SEE ALSO
.br
.B crontab
.BR -c
+.br
+.B crontab
+.BR -V
.SH DESCRIPTION
.I Crontab
is the program used to install a crontab table
, as set using the
.B \-n
option.
+.TP
+.B "\-V"
+Print version and exit.
.SH "SEE ALSO"
.BR crontab (5),
.BR cron (8)
fprintf(stderr, " -P use PATH=\"%s\"\n", _PATH_DEFPATH);
fprintf(stderr, " -c enable clustering support\n");
fprintf(stderr, " -s log into syslog instead of sending mails\n");
+ fprintf(stderr, " -V print version and exit\n");
fprintf(stderr, " -x <flag> print debug information\n");
fprintf(stderr, "\n");
fprintf(stderr, "Debugging flags are: ");
static void parse_args(int argc, char *argv[]) {
int argch;
- while (-1 != (argch = getopt(argc, argv, "hnpsiPx:m:c"))) {
+ while (-1 != (argch = getopt(argc, argv, "hnpsiPx:m:cV"))) {
switch (argch) {
case 'x':
if (!set_debug_flags(optarg))
case 'c':
EnableClustering = 1;
break;
+ case 'V':
+ puts(PACKAGE_STRING);
+ exit(EXIT_SUCCESS);
case 'h':
default:
usage();
fprintf(stderr, " -t time start from this time (seconds since epoch)\n");
fprintf(stderr, " -v verbose mode\n");
fprintf(stderr, " -h this help\n");
+ fprintf(stderr, " -V print version and exit\n");
}
/*
start = time(NULL);
verbose = 0;
- while (-1 != (opt = getopt(argn, argv, "i:e:st:vh"))) {
+ while (-1 != (opt = getopt(argn, argv, "i:e:st:vhV"))) {
switch (opt) {
case 'i':
include = optarg;
case 'h':
usage();
return EXIT_SUCCESS;
+ case 'V':
+ puts(PACKAGE_STRING);
+ return EXIT_SUCCESS;
default:
fprintf(stderr, "unrecognized option: %s\n",
argv[optind - 1]);
static const char *Options[] = {"???", "list", "delete", "edit", "replace", "hostset", "hostget"};
# ifdef WITH_SELINUX
-static const char *getoptargs = "u:lerisncx:";
+static const char *getoptargs = "u:lerisncx:V";
# else
-static const char *getoptargs = "u:lerincx:";
+static const char *getoptargs = "u:lerincx:V";
# endif
#else
# ifdef WITH_SELINUX
-static const char *getoptargs = "u:lerisnc";
+static const char *getoptargs = "u:lerisncV";
# else
-static const char *getoptargs = "u:lerinc";
+static const char *getoptargs = "u:lerincV";
# endif
#endif
#ifdef WITH_SELINUX
#ifdef WITH_SELINUX
fprintf(stderr, " -s selinux context\n");
#endif
+ fprintf(stderr, " -V print version and exit\n");
#ifdef DEBUGGING
fprintf(stderr, " -x <mask> enable debugging\n");
#endif
}
Option = opt_hostget;
break;
+ case 'V':
+ puts(PACKAGE_STRING);
+ exit(EXIT_SUCCESS);
default:
usage("unrecognized option");
}