rpms/crypto-utils/devel keyutil.c,1.7,1.8

Elio Maldonado emaldonado at fedoraproject.org
Sun Oct 19 17:50:38 UTC 2008


Author: emaldonado

Update of /cvs/extras/rpms/crypto-utils/devel
In directory cvs1.fedora.phx.redhat.com:/tmp/cvs-serv3860

Modified Files:
	keyutil.c 
Log Message:
Fixed the usage message


Index: keyutil.c
===================================================================
RCS file: /cvs/extras/rpms/crypto-utils/devel/keyutil.c,v
retrieving revision 1.7
retrieving revision 1.8
diff -u -r1.7 -r1.8
--- keyutil.c	19 Oct 2008 05:08:53 -0000	1.7
+++ keyutil.c	19 Oct 2008 17:50:08 -0000	1.8
@@ -181,24 +181,45 @@
 
 char *progName;
 
+static const struct option options[] = {
+    { "command",    required_argument, NULL, 'c' },
+    { "renew",      required_argument, NULL, 'r' },
+    { "subject",    required_argument, NULL, 's' },
+    { "gkeysize",   required_argument, NULL, 'g' },
+    { "validity",   required_argument, NULL, 'v' },
+    { "encpwdfile", required_argument, NULL, 'e' },
+    { "filepwdnss", required_argument, NULL, 'f' },
+    { "digest",     required_argument, NULL, 'd' },
+    { "znoisefile", required_argument, NULL, 'z' },
+    { "input",      required_argument, NULL, 'i' }, /* key in */
+    { "passout",    required_argument, NULL, 'p' },
+    { "output",     required_argument, NULL, 'o' }, /* reg, cert, enckey */
+    { "keyout",     required_argument, NULL, 'k' }, /* plaintext key */
+    { "ascii",      no_argument,       NULL, 'a' }, /* ascii */
+    { "cacert",     no_argument,       NULL, 't' }, /* ca cert renewal */
+    { "help",       no_argument,       NULL, 'h' },
+    { NULL }
+};
+
 static void 
 Usage(char *progName)
 {
     fprintf(stderr, "Usage: %s [options] arguments\n", progName);
-    fprintf(stderr, "-h print this help message");
-    fprintf(stderr, "-c command, one of [genreq|makecert]");
-    fprintf(stderr, "-r the cert to renew");
-    fprintf(stderr, "-s subject subject distinguished name");
-    fprintf(stderr, "-g keysize in bits");
-    fprintf(stderr, "-v validity in months");
-    fprintf(stderr, "-z noise file");
-    fprintf(stderr, "-f key encryption password file");
-    fprintf(stderr, "-f module access password file");
-    fprintf(stderr, "-d digest algorithm");
-    fprintf(stderr, "-i input (key to encrypt or to sign a request with)");
-    fprintf(stderr, "-k key out, when csr or cert generation");
-    fprintf(stderr, "-o output (a csr or cert)");
-    fprintf(stderr, "-p passout, the pbe password");
+    fprintf(stderr, "{-c|--command} command, one of [genreq|makecert]");
+    fprintf(stderr, "{-r|--renew} cert-to-renew     the file with thecertifificast to renew");
+    fprintf(stderr, "{-s|--subject} subject         subject distinguished name");
+    fprintf(stderr, "{-g|--gsize} key_size          size in bitsof the rsa key to generate");
+    fprintf(stderr, "{-v|--validity} months         cert validity in months");
+    fprintf(stderr, "{-z|--znoisefile} noisefile    seed file for use in key gneration");
+    fprintf(stderr, "{-f|--filepwdnss} pwdfile      file with the key encryption_password");
+    fprintf(stderr, "{-f|--filepwdnss} modpwdfile   file with the module access_password");
+    fprintf(stderr, "{-d|--digest} digest-algorithm digest algorithm");
+    fprintf(stderr, "{-i|--input} inputkey-file     file with key with which to encrypt or to sign a request");
+    fprintf(stderr, "{-p|--passout} pbe-password    the password for encrypting of the key");
+    fprintf(stderr, "{-o|--output} out-file         output file for a csr or cert");
+    fprintf(stderr, "{-k|--keyfile} out-key-file    output key file, with csr or certgen");
+    fprintf(stderr, "{-t|--cacert}                  indicates that cert renewal is for a ca");
+    fprintf(stderr, "{-h|--help}                    print this help message");
     fprintf(stderr, "\n");
     exit(1);
 }
@@ -1606,25 +1627,6 @@
 int main(int argc, char **argv)
 {
     int optc, rv = 0;
-    static const struct option options[] = {
-        { "command",    required_argument, NULL, 'c' },
-        { "renew",      required_argument, NULL, 'r' },
-        { "subject",    required_argument, NULL, 's' },
-        { "gkeysize",   required_argument, NULL, 'g' },
-        { "validity",   required_argument, NULL, 'v' },
-        { "encpwdfile", required_argument, NULL, 'e' },
-        { "filepwdnss", required_argument, NULL, 'f' },
-        { "digest",     required_argument, NULL, 'd' },
-        { "znoisefile", required_argument, NULL, 'z' },
-        { "input",      required_argument, NULL, 'i' }, /* key in */
-        { "passout",    required_argument, NULL, 'p' },
-        { "output",     required_argument, NULL, 'o' }, /* reg, cert, enckey */
-        { "keyout",     required_argument, NULL, 'k' }, /* plaintext key */
-        { "ascii",      no_argument,       NULL, 'a' }, /* ascii */
-        { "cacert",     no_argument,       NULL, 't' }, /* ca cert to renew */
-        { "help",       no_argument,       NULL, 'h' },
-        { NULL }
-    };
     char *cmdstr = NULL;
     char *noisefile = NULL;
     int  keysize = 1024;




More information about the fedora-extras-commits mailing list