summaryrefslogtreecommitdiffstats
path: root/tools/gpgtar.c
diff options
context:
space:
mode:
authorJustus Winter <justus@g10code.com>2015-11-26 15:36:52 +0100
committerJustus Winter <justus@g10code.com>2015-11-26 15:36:52 +0100
commit69a8440f44fa025e33a4cc32d17695c9ac385043 (patch)
tree9197a5c28bedac413fde5b1da44f36d50b411e97 /tools/gpgtar.c
parentcommon: Make the GPG arguments configurable in call-gpg. (diff)
downloadgnupg2-69a8440f44fa025e33a4cc32d17695c9ac385043.tar.xz
gnupg2-69a8440f44fa025e33a4cc32d17695c9ac385043.zip
tools/gpgtar: Handle '--gpg-args'.
* tools/gpgtar-create.c (gpgtar_create): Use given arguments. * tools/gpgtar-extract.c (gpgtar_extract): Likewise. * tools/gpgtar-list.c (gpgtar_list): Likewise. * tools/gpgtar.c (enum cmd_and_opt_values): New value. (opts): Add 'gpg-args'. (parse_arguments): Handle arguments. * tools/gpgtar.h (opt): Add field 'gpg_arguments'. * tests/openpgp/gpgtar.test: Simplify accordingly. Signed-off-by: Justus Winter <justus@g10code.com>
Diffstat (limited to 'tools/gpgtar.c')
-rw-r--r--tools/gpgtar.c16
1 files changed, 16 insertions, 0 deletions
diff --git a/tools/gpgtar.c b/tools/gpgtar.c
index 2968fb5fc..90fee054e 100644
--- a/tools/gpgtar.c
+++ b/tools/gpgtar.c
@@ -75,6 +75,7 @@ enum cmd_and_opt_values
oNull,
/* Compatibility with gpg-zip. */
+ oGpgArgs,
oTarArgs,
};
@@ -111,6 +112,7 @@ static ARGPARSE_OPTS opts[] = {
N_("|FILE|get names to create from FILE")),
ARGPARSE_s_n (oNull, "null", N_("-T reads null-terminated names")),
+ ARGPARSE_s_s (oGpgArgs, "gpg-args", "@"),
ARGPARSE_s_s (oTarArgs, "tar-args", "@"),
ARGPARSE_end ()
@@ -340,6 +342,20 @@ parse_arguments (ARGPARSE_ARGS *pargs, ARGPARSE_OPTS *popts)
case oOpenPGP: /* Dummy option for now. */ break;
case oCMS: /* Dummy option for now. */ break;
+ case oGpgArgs:;
+ strlist_t list;
+ if (shell_parse_stringlist (pargs->r.ret_str, &list))
+ log_error ("failed to parse gpg arguments '%s'\n",
+ pargs->r.ret_str);
+ else
+ {
+ if (opt.gpg_arguments)
+ strlist_last (opt.gpg_arguments)->next = list;
+ else
+ opt.gpg_arguments = list;
+ }
+ break;
+
case oTarArgs:;
int tar_argc;
char **tar_argv;