1
0
mirror of git://git.gnupg.org/gnupg.git synced 2025-01-22 14:57:02 +01:00

* g10.c (main): Trim --help to commonly used options. Remove -f.

This commit is contained in:
David Shaw 2003-09-12 03:29:00 +00:00
parent 405d9dfc59
commit eb18893c8c
2 changed files with 55 additions and 59 deletions

View File

@ -1,3 +1,7 @@
2003-09-11 David Shaw <dshaw@jabberwocky.com>
* g10.c (main): Trim --help to commonly used options. Remove -f.
2003-09-08 David Shaw <dshaw@jabberwocky.com> 2003-09-08 David Shaw <dshaw@jabberwocky.com>
* g10.c (main): Error out if --multifile is used with the commands * g10.c (main): Error out if --multifile is used with the commands

110
g10/g10.c
View File

@ -58,7 +58,6 @@ enum cmd_and_opt_values { aNull = 0,
aSym = 'c', aSym = 'c',
aDecrypt = 'd', aDecrypt = 'd',
aEncr = 'e', aEncr = 'e',
aEncrFiles,
oInteractive = 'i', oInteractive = 'i',
oKOption = 'k', oKOption = 'k',
oDryRun = 'n', oDryRun = 'n',
@ -77,6 +76,7 @@ enum cmd_and_opt_values { aNull = 0,
oCertNotation, oCertNotation,
oShowNotation, oShowNotation,
oNoShowNotation, oNoShowNotation,
aEncrFiles,
aDecryptFiles, aDecryptFiles,
aClearsign, aClearsign,
aStore, aStore,
@ -325,20 +325,20 @@ static ARGPARSE_OPTS opts[] = {
{ 300, NULL, 0, N_("@Commands:\n ") }, { 300, NULL, 0, N_("@Commands:\n ") },
{ aSign, "sign", 256, N_("|[file]|make a signature")}, { aSign, "sign", 256, N_("|[file]|make a signature")},
{ aClearsign, "clearsign", 256, N_("|[file]|make a clear text signature") }, { aClearsign, "clearsign", 256, N_("|[file]|make a clear text signature")},
{ aDetachedSign, "detach-sign", 256, N_("make a detached signature")}, { aDetachedSign, "detach-sign", 256, N_("make a detached signature")},
{ aEncr, "encrypt", 256, N_("encrypt data")}, { aEncr, "encrypt", 256, N_("encrypt data")},
{ aEncrFiles, "encrypt-files", 256, N_("|[files]|encrypt files")}, { aEncrFiles, "encrypt-files", 256, "@"},
{ aSym, "symmetric", 256, N_("encryption only with symmetric cipher")}, { aSym, "symmetric", 256, N_("encryption only with symmetric cipher")},
{ aStore, "store", 256, N_("store only")}, { aStore, "store", 256, "@"},
{ aDecrypt, "decrypt", 256, N_("decrypt data (default)")}, { aDecrypt, "decrypt", 256, N_("decrypt data (default)")},
{ aDecryptFiles, "decrypt-files", 256, N_("|[files]|decrypt files")}, { aDecryptFiles, "decrypt-files", 256, "@"},
{ aVerify, "verify" , 256, N_("verify a signature")}, { aVerify, "verify" , 256, N_("verify a signature")},
{ aVerifyFiles, "verify-files" , 256, "@" }, { aVerifyFiles, "verify-files" , 256, "@" },
{ aListKeys, "list-keys", 256, N_("list keys")}, { aListKeys, "list-keys", 256, N_("list keys")},
{ aListKeys, "list-public-keys", 256, "@" }, { aListKeys, "list-public-keys", 256, "@" },
{ aListSigs, "list-sigs", 256, N_("list keys and signatures")}, { aListSigs, "list-sigs", 256, N_("list keys and signatures")},
{ aCheckKeys, "check-sigs",256, N_("check key signatures")}, { aCheckKeys, "check-sigs",256, N_("list and check key signatures")},
{ oFingerprint, "fingerprint", 256, N_("list keys and fingerprints")}, { oFingerprint, "fingerprint", 256, N_("list keys and fingerprints")},
{ aListSecretKeys, "list-secret-keys", 256, N_("list secret keys")}, { aListSecretKeys, "list-secret-keys", 256, N_("list secret keys")},
{ aKeygen, "gen-key", 256, N_("generate a new key pair")}, { aKeygen, "gen-key", 256, N_("generate a new key pair")},
@ -347,8 +347,8 @@ static ARGPARSE_OPTS opts[] = {
N_("remove keys from the secret keyring")}, N_("remove keys from the secret keyring")},
{ aSignKey, "sign-key" ,256, N_("sign a key")}, { aSignKey, "sign-key" ,256, N_("sign a key")},
{ aLSignKey, "lsign-key" ,256, N_("sign a key locally")}, { aLSignKey, "lsign-key" ,256, N_("sign a key locally")},
{ aNRSignKey, "nrsign-key" ,256, N_("sign a key non-revocably")}, { aNRSignKey, "nrsign-key" ,256, "@"},
{ aNRLSignKey, "nrlsign-key" ,256, N_("sign a key locally and non-revocably")}, { aNRLSignKey, "nrlsign-key" ,256, "@"},
{ aEditKey, "edit-key" ,256, N_("sign or edit a key")}, { aEditKey, "edit-key" ,256, N_("sign or edit a key")},
{ aGenRevoke, "gen-revoke",256, N_("generate a revocation certificate")}, { aGenRevoke, "gen-revoke",256, N_("generate a revocation certificate")},
{ aDesigRevoke, "desig-revoke",256, "@" }, { aDesigRevoke, "desig-revoke",256, "@" },
@ -364,20 +364,17 @@ static ARGPARSE_OPTS opts[] = {
{ aExportSecretSub, "export-secret-subkeys" , 256, "@" }, { aExportSecretSub, "export-secret-subkeys" , 256, "@" },
{ aImport, "import", 256 , N_("import/merge keys")}, { aImport, "import", 256 , N_("import/merge keys")},
{ aFastImport, "fast-import", 256 , "@"}, { aFastImport, "fast-import", 256 , "@"},
{ aListPackets, "list-packets",256,N_("list only the sequence of packets")}, { aListPackets, "list-packets",256, "@"},
{ aExportOwnerTrust, { aExportOwnerTrust, "export-ownertrust", 256, "@"},
"export-ownertrust", 256, N_("export the ownertrust values")}, { aImportOwnerTrust, "import-ownertrust", 256, "@"},
{ aImportOwnerTrust,
"import-ownertrust", 256, N_("import ownertrust values")},
{ aUpdateTrustDB, { aUpdateTrustDB,
"update-trustdb",0 , N_("update the trust database")}, "update-trustdb",0 , N_("update the trust database")},
{ aCheckTrustDB, { aCheckTrustDB, "check-trustdb", 0, "@"},
"check-trustdb",0 , N_("unattended trust database update")}, { aFixTrustDB, "fix-trustdb", 0, "@"},
{ aFixTrustDB, "fix-trustdb",0 , N_("fix a corrupted trust database")}, { aDeArmor, "dearmor", 256, "@"},
{ aDeArmor, "dearmor", 256, N_("De-Armor a file or stdin") }, { aDeArmor, "dearmour", 256, "@"},
{ aDeArmor, "dearmour", 256, "@" }, { aEnArmor, "enarmor", 256, "@"},
{ aEnArmor, "enarmor", 256, N_("En-Armor a file or stdin") }, { aEnArmor, "enarmour", 256, "@"},
{ aEnArmor, "enarmour", 256, "@" },
{ aPrintMD, "print-md" , 256, N_("|algo [files]|print message digests")}, { aPrintMD, "print-md" , 256, N_("|algo [files]|print message digests")},
{ aPrimegen, "gen-prime" , 256, "@" }, { aPrimegen, "gen-prime" , 256, "@" },
{ aGenRandom, "gen-random" , 256, "@" }, { aGenRandom, "gen-random" , 256, "@" },
@ -389,10 +386,8 @@ static ARGPARSE_OPTS opts[] = {
{ oRecipient, "recipient", 2, N_("|NAME|encrypt for NAME")}, { oRecipient, "recipient", 2, N_("|NAME|encrypt for NAME")},
{ oHiddenRecipient, "hidden-recipient", 2, "@" }, { oHiddenRecipient, "hidden-recipient", 2, "@" },
{ oRecipient, "remote-user", 2, "@"}, /* old option name */ { oRecipient, "remote-user", 2, "@"}, /* old option name */
{ oDefRecipient, "default-recipient" ,2, { oDefRecipient, "default-recipient", 2, "@"},
N_("|NAME|use NAME as default recipient")}, { oDefRecipientSelf, "default-recipient-self", 0, "@"},
{ oDefRecipientSelf, "default-recipient-self" ,0,
N_("use the default key as default recipient")},
{ oNoDefRecipient, "no-default-recipient", 0, "@" }, { oNoDefRecipient, "no-default-recipient", 0, "@" },
{ oTempDir, "temp-directory", 2, "@" }, { oTempDir, "temp-directory", 2, "@" },
{ oExecPath, "exec-path", 2, "@" }, { oExecPath, "exec-path", 2, "@" },
@ -412,43 +407,42 @@ static ARGPARSE_OPTS opts[] = {
{ oNoAskCertExpire, "no-ask-cert-expire", 0, "@"}, { oNoAskCertExpire, "no-ask-cert-expire", 0, "@"},
{ oOutput, "output", 2, N_("use as output file")}, { oOutput, "output", 2, N_("use as output file")},
{ oVerbose, "verbose", 0, N_("verbose") }, { oVerbose, "verbose", 0, N_("verbose") },
{ oQuiet, "quiet", 0, N_("be somewhat more quiet") }, { oQuiet, "quiet", 0, "@"},
{ oNoTTY, "no-tty", 0, N_("don't use the terminal at all") }, { oNoTTY, "no-tty", 0, "@"},
{ oForceV3Sigs, "force-v3-sigs", 0, N_("force v3 signatures") }, { oForceV3Sigs, "force-v3-sigs", 0, "@"},
{ oNoForceV3Sigs, "no-force-v3-sigs", 0, N_("do not force v3 signatures") }, { oNoForceV3Sigs, "no-force-v3-sigs", 0, "@"},
{ oForceV4Certs, "force-v4-certs", 0, N_("force v4 key signatures") }, { oForceV4Certs, "force-v4-certs", 0, "@"},
{ oNoForceV4Certs, "no-force-v4-certs", 0, N_("do not force v4 key signatures") }, { oNoForceV4Certs, "no-force-v4-certs", 0, "@"},
{ oForceMDC, "force-mdc", 0, N_("always use a MDC for encryption") }, { oForceMDC, "force-mdc", 0, "@"},
{ oNoForceMDC, "no-force-mdc", 0, "@" }, { oNoForceMDC, "no-force-mdc", 0, "@" },
{ oDisableMDC, "disable-mdc", 0, N_("never use a MDC for encryption") }, { oDisableMDC, "disable-mdc", 0, "@"},
{ oNoDisableMDC, "no-disable-mdc", 0, "@" }, { oNoDisableMDC, "no-disable-mdc", 0, "@" },
{ oDryRun, "dry-run", 0, N_("do not make any changes") }, { oDryRun, "dry-run", 0, N_("do not make any changes") },
{ oInteractive, "interactive", 0, N_("prompt before overwriting") }, { oInteractive, "interactive", 0, N_("prompt before overwriting") },
{ oUseAgent, "use-agent",0, N_("use the gpg-agent")}, { oUseAgent, "use-agent",0, "@"},
{ oNoUseAgent, "no-use-agent",0, "@"}, { oNoUseAgent, "no-use-agent",0, "@"},
{ oGpgAgentInfo, "gpg-agent-info",2, "@"}, { oGpgAgentInfo, "gpg-agent-info",2, "@"},
{ oBatch, "batch", 0, N_("batch mode: never ask")}, { oBatch, "batch", 0, "@"},
{ oAnswerYes, "yes", 0, N_("assume yes on most questions")}, { oAnswerYes, "yes", 0, "@"},
{ oAnswerNo, "no", 0, N_("assume no on most questions")}, { oAnswerNo, "no", 0, "@"},
{ oKeyring, "keyring" ,2, N_("add this keyring to the list of keyrings")}, { oKeyring, "keyring", 2, "@"},
{ oPrimaryKeyring, "primary-keyring",2, "@" }, { oPrimaryKeyring, "primary-keyring",2, "@" },
{ oSecretKeyring, "secret-keyring" ,2, N_("add this secret keyring to the list")}, { oSecretKeyring, "secret-keyring", 2, "@"},
{ oShowKeyring, "show-keyring", 0, "@"}, { oShowKeyring, "show-keyring", 0, "@"},
{ oDefaultKey, "default-key" ,2, N_("|NAME|use NAME as default secret key")}, { oDefaultKey, "default-key", 2, "@"},
{ oKeyServer, "keyserver",2, N_("|HOST|use this keyserver to lookup keys")}, { oKeyServer, "keyserver", 2, "@"},
{ oKeyServerOptions, "keyserver-options",2,"@"}, { oKeyServerOptions, "keyserver-options",2,"@"},
{ oImportOptions, "import-options",2,"@"}, { oImportOptions, "import-options",2,"@"},
{ oExportOptions, "export-options",2,"@"}, { oExportOptions, "export-options",2,"@"},
{ oListOptions, "list-options",2,"@"}, { oListOptions, "list-options",2,"@"},
{ oVerifyOptions, "verify-options",2,"@"}, { oVerifyOptions, "verify-options",2,"@"},
{ oCharset, "charset" , 2, N_("|NAME|set terminal charset to NAME") }, { oCharset, "charset", 2, "@"},
{ oOptions, "options" , 2, N_("read options from file")}, { oOptions, "options", 2, "@"},
{ oDebug, "debug" ,4|16, "@"}, { oDebug, "debug" ,4|16, "@"},
{ oDebugAll, "debug-all" ,0, "@"}, { oDebugAll, "debug-all" ,0, "@"},
{ oStatusFD, "status-fd" ,1, N_("|FD|write status info to this FD") }, { oStatusFD, "status-fd" ,1, "@"},
#ifdef __riscos__ #ifdef __riscos__
{ oStatusFile, "status-file" ,2, N_("|[file]|write status info to file") }, { oStatusFile, "status-file" ,2, "@"},
#endif /* __riscos__ */ #endif /* __riscos__ */
{ oAttributeFD, "attribute-fd" ,1, "@" }, { oAttributeFD, "attribute-fd" ,1, "@" },
#ifdef __riscos__ #ifdef __riscos__
@ -460,31 +454,29 @@ static ARGPARSE_OPTS opts[] = {
{ oCompletesNeeded, "completes-needed", 1, "@"}, { oCompletesNeeded, "completes-needed", 1, "@"},
{ oMarginalsNeeded, "marginals-needed", 1, "@"}, { oMarginalsNeeded, "marginals-needed", 1, "@"},
{ oMaxCertDepth, "max-cert-depth", 1, "@" }, { oMaxCertDepth, "max-cert-depth", 1, "@" },
{ oTrustedKey, "trusted-key", 2, N_("|KEYID|ultimately trust this key")}, { oTrustedKey, "trusted-key", 2, "@"},
{ oLoadExtension, "load-extension" ,2, N_("|FILE|load extension module FILE")}, { oLoadExtension, "load-extension", 2, "@"},
{ oGnuPG, "gnupg", 0, "@"}, { oGnuPG, "gnupg", 0, "@"},
{ oGnuPG, "no-pgp2", 0, "@"}, { oGnuPG, "no-pgp2", 0, "@"},
{ oGnuPG, "no-pgp6", 0, "@"}, { oGnuPG, "no-pgp6", 0, "@"},
{ oGnuPG, "no-pgp7", 0, "@"}, { oGnuPG, "no-pgp7", 0, "@"},
{ oGnuPG, "no-pgp8", 0, "@"}, { oGnuPG, "no-pgp8", 0, "@"},
{ oRFC1991, "rfc1991", 0, N_("emulate the mode described in RFC1991")}, { oRFC1991, "rfc1991", 0, "@"},
{ oRFC2440, "rfc2440", 0, "@" }, { oRFC2440, "rfc2440", 0, "@" },
{ oOpenPGP, "openpgp", 0, N_("set all packet, cipher and digest options to OpenPGP behavior")}, { oOpenPGP, "openpgp", 0, N_("use strict OpenPGP behavior")},
{ oPGP2, "pgp2", 0, N_("set all packet, cipher and digest options to PGP 2.x behavior")}, { oPGP2, "pgp2", 0, N_("generate PGP 2.x compatible messages")},
{ oPGP6, "pgp6", 0, "@"}, { oPGP6, "pgp6", 0, "@"},
{ oPGP7, "pgp7", 0, "@"}, { oPGP7, "pgp7", 0, "@"},
{ oPGP8, "pgp8", 0, "@"}, { oPGP8, "pgp8", 0, "@"},
{ oS2KMode, "s2k-mode", 1, N_("|N|use passphrase mode N")}, { oS2KMode, "s2k-mode", 1, "@"},
{ oS2KDigest, "s2k-digest-algo",2, { oS2KDigest, "s2k-digest-algo", 2, "@"},
N_("|NAME|use message digest algorithm NAME for passphrases")}, { oS2KCipher, "s2k-cipher-algo", 2, "@"},
{ oS2KCipher, "s2k-cipher-algo",2,
N_("|NAME|use cipher algorithm NAME for passphrases")},
{ oSimpleSKChecksum, "simple-sk-checksum", 0, "@"}, { oSimpleSKChecksum, "simple-sk-checksum", 0, "@"},
{ oCipherAlgo, "cipher-algo", 2 , N_("|NAME|use cipher algorithm NAME")}, { oCipherAlgo, "cipher-algo", 2, "@"},
{ oDigestAlgo, "digest-algo", 2 , N_("|NAME|use message digest algorithm NAME")}, { oDigestAlgo, "digest-algo", 2, "@"},
{ oCertDigestAlgo, "cert-digest-algo", 2 , "@" }, { oCertDigestAlgo, "cert-digest-algo", 2 , "@" },
{ oCompressAlgo,"compress-algo",2,N_("|NAME|use compression algorithm NAME")}, { oCompressAlgo,"compress-algo", 2, "@"},
{ oThrowKeyid, "throw-keyid", 0, N_("throw keyid field of encrypted packets")}, { oThrowKeyid, "throw-keyid", 0, "@"},
{ oNoThrowKeyid, "no-throw-keyid", 0, "@" }, { oNoThrowKeyid, "no-throw-keyid", 0, "@" },
{ oShowPhotos, "show-photos", 0, "@" }, { oShowPhotos, "show-photos", 0, "@" },
{ oNoShowPhotos, "no-show-photos", 0, "@" }, { oNoShowPhotos, "no-show-photos", 0, "@" },