changed usage (--help) message, to be shorter and clearer

This commit is contained in:
TLINDEN
2014-01-30 20:55:23 +01:00
parent 871a3c7696
commit 1b1cdecf3f
27 changed files with 1304 additions and 1941 deletions

View File

@@ -1,4 +1,4 @@
# Makefile.in generated by automake 1.12.6 from Makefile.am.
# Makefile.in generated by automake 1.12.4 from Makefile.am.
# @configure_input@
# Copyright (C) 1994-2012 Free Software Foundation, Inc.

View File

@@ -39,6 +39,7 @@
#include "keyprint.h"
#include "keyhash.h"
#include "util.h"
#include "base85.h"
#define _WITH_GETLINE

View File

@@ -78,9 +78,8 @@
0x00028F70
*/
#define PCP_HELP_INTRO "This is Pretty Curved Privacy. Licensed under the GPLv3. This\n" \
"is BETA software. Use with care. NOT intended for production\n" \
"use.\n"
#define PCP_HELP_INTRO "This is Pretty Curved Privacy. Licensed under the GPLv3. This is\n" \
"BETA software. Use with care. NOT intended for production use.\n"
vault_t *vault;
int debug;

View File

@@ -1,120 +1,46 @@
#ifndef _HAVE_USAGE_H
#define _HAVE_USAGE_H
#define PCP_HELP "\n" \
"Usage: pcp1 [options]\n" \
"Usage: pcp1 [ --help | --version ]\n" \
" [ --keygen | --listkeys | --remove-key | --edit-key ]\n" \
" [ --export-public | --export-secret | --import-public | --import-secret ]\n" \
" [ --encrypt | --decrypt ]\n" \
" [ --sign | --check-signature ]\n" \
"\n" \
"General Options:\n" \
"-V --vault <vaultfile> Specify an alternate vault file.\n" \
" The deault vault is ~/.pcpvault.\n" \
"-O --outfile <file> Output file. If not specified, stdout\n" \
" will be used.\n" \
"-I --infile <file> Input file. If not specified, stdin\n" \
" will be used.\n" \
"-i --keyid <id> Specify a key id to import/export.\n" \
"-r --recipient <string> Specify a recpipient, used for public\n" \
" key export and encryption.\n" \
"-t --text Print textual representation of some\n" \
" item. Specify -V to get info about a\n" \
" vault, -i to get info about a key id\n" \
" installed in the vault or -I in which\n" \
" case it determines itself what kind of\n" \
" file it is.\n" \
"-h --help Print this help message.\n" \
"-v --version Print program version.\n" \
"-D --debug Enable debug output.\n" \
"-V --vault <vaultfile> Specify an alternate vault file.\n" \
"-O --outfile <file> Output file. STDOUT if unspecified.\n" \
"-I --infile <file> Input file. STDIN if unspecified.\n" \
"-i --keyid <id> Specify a key id for various operations.\n" \
"-r --recipient <string> Specify a recpipient, multiple allowed.\n" \
"-t --text Print textual representation of ojects.\n" \
"\n" \
"Keymanagement Options:\n" \
"-k --keygen Generate a CURVE25519 secret key. If\n" \
" the generated key is the first one in\n" \
" your vault, it will become the primary\n" \
" secret key. If an output file (-O) has\n" \
" been specified, don't store the generated\n" \
" key to the vault but export it to the\n" \
" file instead. You will be asked for\n" \
" an owner, mail and a passphrase. If you\n" \
" leave the passphrase empty, the key will\n" \
" be stored unencrypted.\n" \
"-l --listkeys List all keys currently stored in your\n" \
" vault. Only the key id's and some info\n" \
" about the keys will be printed, not the\n" \
" actual keys.\n" \
"-R --remove-key Remove a key from the vault. Requires\n" \
" option -i <keyid>.\n" \
"-s --export-secret Export a secret key. If your vault only\n" \
" contains one secret key, this one will\n" \
" be exported. If a key id have been\n" \
" specified (-i), this one will be used.\n" \
" If there are more than one secret keys\n" \
" in the vault and no key id has been\n" \
" given, export the primary secret key.\n" \
" Use -O to export to a file.\n" \
"-p --export-public Export a public key. If no key id have\n" \
" been specified, the public part of your\n" \
" primary secret key will be exported.\n" \
" Use -O to export to a file.\n" \
"-S --import-secret Import a secret key. Use -I to import\n" \
" from a file.\n" \
"-P --import-public Import a public key. Use -I to import\n" \
" from a file.\n" \
"-y --export-yaml Export all keys stored in your vault\n" \
" as YAML formatted text. Use -O to put\n" \
" the export into a file.\n" \
"-k --keygen Generate new key pair.\n" \
"-l --listkeys List all keys stored in your vault.\n" \
"-R --remove-key Remove a key from the vault.\n" \
"-s --export-secret Export a secret key.\n" \
"-p --export-public Export a public key.\n" \
"-S --import-secret Import a secret key.\n" \
"-P --import-public Import a public key.\n" \
"-y --export-yaml Export all keys as YAML formatted text.\n" \
"-b --pbpcompat Enable PBP compatibility for public key\n" \
" exports and imports.\n" \
"\n" \
"Encryption Options:\n" \
"-e --encrypt Asym-Encrypt a message. Read from stdin or\n" \
" specified via -I. Output will be written\n" \
" to stdout or the file given with -O.\n" \
" If a keyid (-i) has been\n" \
" given, use that public key for encryption.\n" \
" If one or more recipient (-r) has been given,\n" \
" encrypt the message for all recipients\n" \
" asymetrically, given there are matching\n" \
" public keys installed in the vault for them.\n" \
" If none of -i or -r has been given, encrypt\n" \
" the message symetrically. This is the same\n" \
" as -m (self-encryption mode).\n" \
"-m --encrypt-me Sym-Encrypt a message. Specify -I and/or\n" \
" -O for input/output file. You will be asked\n" \
" for a passphrase. No key material will\n" \
" be used. Same as -e without -r and -i.\n" \
"-d --decrypt Decrypt a message. Read from stdin or\n" \
" specified via -I. Output to stdout or\n" \
" written to the file specified via -O.\n" \
" The primary secret key will be used for\n" \
" decryption, if there is no primary and\n" \
" just one secret key in the vault, this\n" \
" one will be used. Otherwise you'll have\n" \
" to specify the keyid (-i) of the key.\n" \
" You need to have the public key of the\n" \
" sender installed in your vault.\n" \
" If the input is self-encrypted (symetrically)\n" \
" a passphrase will be requested.\n" \
"-e --encrypt Asym-Encrypt a message. If none of -i or -r\n" \
" has been given, encrypt the message symetrically.\n" \
"-m --encrypt-me Symetrically encrypt a message.\n" \
"-d --decrypt Decrypt a message.\n" \
"\n" \
"Signature Options:\n" \
"-g --sign Create a signature of file specified with\n" \
" -I (or from stdin) using your primary\n" \
" secret key. If -r has been given, a derived\n" \
" secret key will be used for signing.\n" \
"-c --check-signature <file> Verify a signature in file <file> against\n" \
" the file specified with -I (or stdin).\n" \
" The public key required for this must\n" \
" exist in your vault file.\n" \
"-f --sigfile <file> Write a detached signature file, which doesn't\n" \
" contain the original content. Output will be\n" \
" z85 encoded always. To verify, you need to\n" \
" specify the original file to be verified\n" \
" against using -I as well (plus -f <sigfile>).\n" \
"-g --sign Create a signature of a file.\n" \
"-c --check-signature <file> Verify a detached signature in file <file>.\n" \
"-f --sigfile <file> Write a detached signature file.\n" \
"\n" \
"Encoding Options:\n" \
"-z --z85-encode Encode something to Z85 encoding. Use\n" \
" -I and -O respectively, otherwise it\n" \
" stdin/stdout.\n" \
"-Z --z85-decode Decode something from Z85 encoding. Use\n" \
" -I and -O respectively, otherwise it\n" \
" stdin/stdout\n" \
"\n" \
"\n" \
"-z --z85-encode Armor with Z85 encoding.\n" \
"\n"
#endif

View File

@@ -1,116 +1,42 @@
Usage: pcp1 [options]
Usage: pcp1 [ --help | --version ]
[ --keygen | --listkeys | --remove-key | --edit-key ]
[ --export-public | --export-secret | --import-public | --import-secret ]
[ --encrypt | --decrypt ]
[ --sign | --check-signature ]
General Options:
-V --vault <vaultfile> Specify an alternate vault file.
The deault vault is ~/.pcpvault.
-O --outfile <file> Output file. If not specified, stdout
will be used.
-I --infile <file> Input file. If not specified, stdin
will be used.
-i --keyid <id> Specify a key id to import/export.
-r --recipient <string> Specify a recpipient, used for public
key export and encryption.
-t --text Print textual representation of some
item. Specify -V to get info about a
vault, -i to get info about a key id
installed in the vault or -I in which
case it determines itself what kind of
file it is.
-h --help Print this help message.
-v --version Print program version.
-D --debug Enable debug output.
-V --vault <vaultfile> Specify an alternate vault file.
-O --outfile <file> Output file. STDOUT if unspecified.
-I --infile <file> Input file. STDIN if unspecified.
-i --keyid <id> Specify a key id for various operations.
-r --recipient <string> Specify a recpipient, multiple allowed.
-t --text Print textual representation of ojects.
Keymanagement Options:
-k --keygen Generate a CURVE25519 secret key. If
the generated key is the first one in
your vault, it will become the primary
secret key. If an output file (-O) has
been specified, don't store the generated
key to the vault but export it to the
file instead. You will be asked for
an owner, mail and a passphrase. If you
leave the passphrase empty, the key will
be stored unencrypted.
-l --listkeys List all keys currently stored in your
vault. Only the key id's and some info
about the keys will be printed, not the
actual keys.
-R --remove-key Remove a key from the vault. Requires
option -i <keyid>.
-s --export-secret Export a secret key. If your vault only
contains one secret key, this one will
be exported. If a key id have been
specified (-i), this one will be used.
If there are more than one secret keys
in the vault and no key id has been
given, export the primary secret key.
Use -O to export to a file.
-p --export-public Export a public key. If no key id have
been specified, the public part of your
primary secret key will be exported.
Use -O to export to a file.
-S --import-secret Import a secret key. Use -I to import
from a file.
-P --import-public Import a public key. Use -I to import
from a file.
-y --export-yaml Export all keys stored in your vault
as YAML formatted text. Use -O to put
the export into a file.
-k --keygen Generate new key pair.
-l --listkeys List all keys stored in your vault.
-R --remove-key Remove a key from the vault.
-s --export-secret Export a secret key.
-p --export-public Export a public key.
-S --import-secret Import a secret key.
-P --import-public Import a public key.
-y --export-yaml Export all keys as YAML formatted text.
-b --pbpcompat Enable PBP compatibility for public key
exports and imports.
Encryption Options:
-e --encrypt Asym-Encrypt a message. Read from stdin or
specified via -I. Output will be written
to stdout or the file given with -O.
If a keyid (-i) has been
given, use that public key for encryption.
If one or more recipient (-r) has been given,
encrypt the message for all recipients
asymetrically, given there are matching
public keys installed in the vault for them.
If none of -i or -r has been given, encrypt
the message symetrically. This is the same
as -m (self-encryption mode).
-m --encrypt-me Sym-Encrypt a message. Specify -I and/or
-O for input/output file. You will be asked
for a passphrase. No key material will
be used. Same as -e without -r and -i.
-d --decrypt Decrypt a message. Read from stdin or
specified via -I. Output to stdout or
written to the file specified via -O.
The primary secret key will be used for
decryption, if there is no primary and
just one secret key in the vault, this
one will be used. Otherwise you'll have
to specify the keyid (-i) of the key.
You need to have the public key of the
sender installed in your vault.
If the input is self-encrypted (symetrically)
a passphrase will be requested.
-e --encrypt Asym-Encrypt a message. If none of -i or -r
has been given, encrypt the message symetrically.
-m --encrypt-me Symetrically encrypt a message.
-d --decrypt Decrypt a message.
Signature Options:
-g --sign Create a signature of file specified with
-I (or from stdin) using your primary
secret key. If -r has been given, a derived
secret key will be used for signing.
-c --check-signature <file> Verify a signature in file <file> against
the file specified with -I (or stdin).
The public key required for this must
exist in your vault file.
-f --sigfile <file> Write a detached signature file, which doesn't
contain the original content. Output will be
z85 encoded always. To verify, you need to
specify the original file to be verified
against using -I as well (plus -f <sigfile>).
-g --sign Create a signature of a file.
-c --check-signature <file> Verify a detached signature in file <file>.
-f --sigfile <file> Write a detached signature file.
Encoding Options:
-z --z85-encode Encode something to Z85 encoding. Use
-I and -O respectively, otherwise it
stdin/stdout.
-Z --z85-decode Decode something from Z85 encoding. Use
-I and -O respectively, otherwise it
stdin/stdout
-z --z85-encode Armor with Z85 encoding.