pki tool supports single letter short options
[strongswan.git] / src / pki / commands / verify.c
index 6905112..26a6dca 100644 (file)
@@ -29,10 +29,13 @@ static int verify(int argc, char *argv[])
 
        while (TRUE)
        {
-               switch (getopt_long(argc, argv, "", command_opts, NULL))
+               switch (getopt_long(argc, argv, command_optstring, command_opts, NULL))
                {
                        case 'h':
-                               return command_usage(CMD_VERIFY, NULL);
+                               return command_usage(NULL);
+                       case 'v':
+                               dbg_level = atoi(optarg);
+                               continue;
                        case 'i':
                                file = optarg;
                                continue;
@@ -42,7 +45,7 @@ static int verify(int argc, char *argv[])
                        case EOF:
                                break;
                        default:
-                               return command_usage(CMD_VERIFY, "invalid --verify option");
+                               return command_usage("invalid --verify option");
                }
                break;
        }
@@ -121,7 +124,7 @@ static int verify(int argc, char *argv[])
  */
 static void __attribute__ ((constructor))reg()
 {
-       command_register(CMD_VERIFY, (command_t) {
+       command_register((command_t) {
                verify, 'v', "verify",
                "verify a certificate using the CA certificate",
                {"[--in file] [--ca file]"},
@@ -129,6 +132,7 @@ static void __attribute__ ((constructor))reg()
                        {"help",        'h', 0, "show usage information"},
                        {"in",          'i', 1, "x509 certifcate to verify, default: stdin"},
                        {"cacert",      'c', 1, "CA certificate, default: verify self signed"},
+                       {"debug",       'v', 1, "set debug level, default: 1"},
                }
        });
 }