[Opendnssec-commits] [keihatsu.kirei.se/svn/dnssec] r3836 - trunk/OpenDNSSEC/enforcer/utils

Rickard Bellgrim rickard.bellgrim at iis.se
Tue Aug 31 12:21:40 CEST 2010


Author: rb
Date: 2010-08-31 12:21:40 +0200 (Tue, 31 Aug 2010)
New Revision: 3836

Modified:
   trunk/OpenDNSSEC/enforcer/utils/ksmutil.c
   trunk/OpenDNSSEC/enforcer/utils/ods-ksmutil.1.in
Log:
Implement --version and -V for ods-ksmutil


Modified: trunk/OpenDNSSEC/enforcer/utils/ksmutil.c
===================================================================
--- trunk/OpenDNSSEC/enforcer/utils/ksmutil.c	2010-08-31 10:09:40 UTC (rev 3835)
+++ trunk/OpenDNSSEC/enforcer/utils/ksmutil.c	2010-08-31 10:21:40 UTC (rev 3836)
@@ -109,6 +109,14 @@
 static int restart_enforcerd(void);
 
     void
+usage_general ()
+{
+    fprintf(stderr,
+            "  help\n"
+            "  --version                                      aka -V\n");
+}
+
+    void
 usage_setup ()
 {
     fprintf(stderr,
@@ -352,6 +360,7 @@
             "usage: %s [-f config] command [options]\n\n",
 	    progname);
 
+    usage_general ();
     usage_setup ();
     usage_update ();
     usage_zoneadd ();
@@ -2840,6 +2849,7 @@
         {"keytype", required_argument, 0, 't'},
         {"time",    required_argument, 0, 'w'},
         {"verbose", no_argument,       0, 'v'},
+        {"version", no_argument,       0, 'V'},
         {"keytag",  required_argument, 0, 'x'},
         {"retire",  required_argument, 0, 'y'},
         {"zone",    required_argument, 0, 'z'},
@@ -2848,7 +2858,7 @@
 
     progname = argv[0];
 
-    while ((ch = getopt_long(argc, argv, "ab:c:de:fg:hi:k:n:o:p:r:s:t:vw:x:y:z:", long_options, &option_index)) != -1) {
+    while ((ch = getopt_long(argc, argv, "ab:c:de:fg:hi:k:n:o:p:r:s:t:vVw:x:y:z:", long_options, &option_index)) != -1) {
         switch (ch) {
             case 'a':
                 all_flag = 1;
@@ -2905,6 +2915,10 @@
             case 't':
                 o_keytype = StrStrdup(optarg);
                 break;
+            case 'V':
+                printf("%s version %s\n", PACKAGE_NAME, PACKAGE_VERSION);
+                exit(0);
+                break;
             case 'v':
                 verbose_flag = 1;
                 break;

Modified: trunk/OpenDNSSEC/enforcer/utils/ods-ksmutil.1.in
===================================================================
--- trunk/OpenDNSSEC/enforcer/utils/ods-ksmutil.1.in	2010-08-31 10:09:40 UTC (rev 3835)
+++ trunk/OpenDNSSEC/enforcer/utils/ods-ksmutil.1.in	2010-08-31 10:21:40 UTC (rev 3836)
@@ -64,6 +64,9 @@
 or it can be used after a partial subcommand.  In response,
 .I ods-ksmutil
 will give a synopsis of how to continue the command.
+.TP
+.B \-V, \-\-version
+Display version number
 .SH "SETUP AND UPDATE SUBCOMMANDS"
 .LP
 .TP




More information about the Opendnssec-commits mailing list