clamconf: handle --version/-V

git-svn: trunk@4630
remotes/push_mirror/0.95
Tomasz Kojm 17 years ago
parent 63375d8d31
commit a128eb8063
  1. 4
      ChangeLog
  2. 7
      clamconf/clamconf.c
  3. 3
      docs/man/clamconf.1.in
  4. 2
      shared/optparser.c

@ -1,3 +1,7 @@
Thu Jan 22 15:59:43 CET 2009 (tk)
---------------------------------
* clamconf: handle --version/-V
Thu Jan 22 15:52:14 CET 2009 (tk)
---------------------------------
* libclamav/dlp.c: disable the test for ssn_max_group (bb#1355)

@ -95,6 +95,7 @@ static void help(void)
printf(" (C) 2009 Sourcefire, Inc.\n\n");
printf(" --help -h Show help\n");
printf(" --version -V Show version\n");
printf(" --config-dir=DIR -c DIR Read configuration files from DIR\n");
printf(" --non-default -n Only display non-default settings\n");
printf("\n");
@ -121,6 +122,12 @@ int main(int argc, char **argv)
return 0;
}
if(optget(opts, "version")->enabled) {
printf("Clam AntiVirus Configuration Tool %s\n", get_version());
optfree(opts);
return 0;
}
printf("ClamAV engine version: %s\n", get_version());
/* TODO: db information */

@ -15,6 +15,9 @@ clamconf displays the values of configuration options.
\fB\-h, \-\-help\fR
Display help and exit.
.TP
\fB\-V, \-\-version\fR
Display software version and exit.
.TP
\fB\-c DIR, \-\-config\-dir DIR\fR
Search for configuration files clamd.conf and freshclam.conf in DIR.
.TP

@ -63,7 +63,7 @@ const struct clam_option clam_options[] = {
{ NULL, "config-file", 'c', TYPE_STRING, NULL, 0, CONFDIR"/clamd.conf", FLAG_REQUIRED, OPT_CLAMD | OPT_CLAMDSCAN, "", "" },
{ NULL, "config-file", 0, TYPE_STRING, NULL, 0, CONFDIR"/freshclam.conf", FLAG_REQUIRED, OPT_FRESHCLAM, "", "" },
{ NULL, "config-file", 'c', TYPE_STRING, NULL, 0, CONFDIR"/clamav-milter.conf", FLAG_REQUIRED, OPT_MILTER, "", "" },
{ NULL, "version", 'V', TYPE_BOOL, MATCH_BOOL, 0, NULL, 0, OPT_CLAMD | OPT_FRESHCLAM | OPT_CLAMSCAN | OPT_CLAMDSCAN | OPT_SIGTOOL | OPT_MILTER, "", "" },
{ NULL, "version", 'V', TYPE_BOOL, MATCH_BOOL, 0, NULL, 0, OPT_CLAMD | OPT_FRESHCLAM | OPT_CLAMSCAN | OPT_CLAMDSCAN | OPT_SIGTOOL | OPT_MILTER | OPT_CLAMCONF, "", "" },
{ NULL, "debug", 0, TYPE_BOOL, MATCH_BOOL, 0, NULL, 0, OPT_CLAMD | OPT_FRESHCLAM | OPT_CLAMSCAN | OPT_SIGTOOL, "", "" },
{ NULL, "verbose", 'v', TYPE_BOOL, MATCH_BOOL, 0, NULL, 0, OPT_FRESHCLAM | OPT_CLAMSCAN | OPT_CLAMDSCAN | OPT_SIGTOOL, "", "" },
{ NULL, "quiet", 0, TYPE_BOOL, MATCH_BOOL, 0, NULL, 0, OPT_FRESHCLAM | OPT_CLAMSCAN | OPT_CLAMDSCAN | OPT_SIGTOOL, "", "" },

Loading…
Cancel
Save