diff options
author | Justus Winter <justus@g10code.com> | 2015-11-25 18:29:22 +0100 |
---|---|---|
committer | Justus Winter <justus@g10code.com> | 2015-11-25 18:29:22 +0100 |
commit | 127aba9a4d6c1aabb4a18a74b16d3bddc6eb5c54 (patch) | |
tree | acadf0ca51c1fdad8ea62e0e3864905f2968d04b /tools/gpgtar.c | |
parent | tools/gpgtar: Handle '--gpg' argument. (diff) | |
download | gnupg2-127aba9a4d6c1aabb4a18a74b16d3bddc6eb5c54.tar.xz gnupg2-127aba9a4d6c1aabb4a18a74b16d3bddc6eb5c54.zip |
tools/gpgtar: Handle '--directory' argument.
* tools/gpgtar-extract.c (gpgtar_extract): Only generate a directory
name if none is given via arguments.
* tools/gpgtar.c (enum cmd_and_opt_values): New constant.
(opts): Add argument.
(main): Parse argument.
* tools/gpgtar.h (opt): New field 'directory'.
Signed-off-by: Justus Winter <justus@g10code.com>
Diffstat (limited to 'tools/gpgtar.c')
-rw-r--r-- | tools/gpgtar.c | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/tools/gpgtar.c b/tools/gpgtar.c index c4bf855cd..991fbedf6 100644 --- a/tools/gpgtar.c +++ b/tools/gpgtar.c @@ -58,6 +58,7 @@ enum cmd_and_opt_values oRecipient = 'r', oUser = 'u', oOutput = 'o', + oDirectory = 'C', oQuiet = 'q', oVerbose = 'v', oFilesFrom = 'T', @@ -89,6 +90,8 @@ static ARGPARSE_OPTS opts[] = { ARGPARSE_s_s (oUser, "local-user", N_("|USER-ID|use USER-ID to sign or decrypt")), ARGPARSE_s_s (oOutput, "output", N_("|FILE|write output to FILE")), + ARGPARSE_s_s (oDirectory, "directory", + N_("|DIRECTORY|extract files into DIRECTORY")), ARGPARSE_s_n (oVerbose, "verbose", N_("verbose")), ARGPARSE_s_n (oQuiet, "quiet", N_("be somewhat more quiet")), ARGPARSE_s_s (oGpgProgram, "gpg", "@"), @@ -194,6 +197,7 @@ main (int argc, char **argv) switch (pargs.r_opt) { case oOutput: opt.outfile = pargs.r.ret_str; break; + case oDirectory: opt.directory = pargs.r.ret_str; break; case oSetFilename: opt.filename = pargs.r.ret_str; break; case oQuiet: opt.quiet = 1; break; case oVerbose: opt.verbose++; break; |