diff options
Diffstat (limited to 'tools/gpgtar.c')
-rw-r--r-- | tools/gpgtar.c | 26 |
1 files changed, 24 insertions, 2 deletions
diff --git a/tools/gpgtar.c b/tools/gpgtar.c index c15f3dcd0..8131c99a1 100644 --- a/tools/gpgtar.c +++ b/tools/gpgtar.c @@ -76,12 +76,18 @@ enum cmd_and_opt_values oNull, oUtf8Strings, + oBatch, + oAnswerYes, + oAnswerNo, + oStatusFD, + oRequireCompliance, + /* Compatibility with gpg-zip. */ oGpgArgs, oTarArgs, /* Debugging. */ - oDryRun, + oDryRun }; @@ -112,6 +118,12 @@ static ARGPARSE_OPTS opts[] = { ARGPARSE_s_n (oOpenPGP, "openpgp", "@"), ARGPARSE_s_n (oCMS, "cms", "@"), + ARGPARSE_s_n (oBatch, "batch", "@"), + ARGPARSE_s_n (oAnswerYes, "yes", "@"), + ARGPARSE_s_n (oAnswerNo, "no", "@"), + ARGPARSE_s_i (oStatusFD, "status-fd", "@"), + ARGPARSE_s_n (oRequireCompliance, "require-compliance", "@"), + ARGPARSE_group (302, N_("@\nTar options:\n ")), ARGPARSE_s_s (oDirectory, "directory", @@ -372,6 +384,12 @@ parse_arguments (ARGPARSE_ARGS *pargs, ARGPARSE_OPTS *popts) case oOpenPGP: /* Dummy option for now. */ break; case oCMS: /* Dummy option for now. */ break; + case oBatch: opt.batch = 1; break; + case oAnswerYes: opt.answer_yes = 1; break; + case oAnswerNo: opt.answer_no = 1; break; + case oStatusFD: opt.status_fd = pargs->r.ret_int; break; + case oRequireCompliance: opt.require_compliance = 1; break; + case oGpgArgs:; { strlist_t list; @@ -437,9 +455,13 @@ main (int argc, char **argv) /* Make sure that our subsystems are ready. */ i18n_init(); init_common_subsystems (&argc, &argv); + gnupg_init_signals (0, NULL); log_assert (sizeof (struct ustar_raw_header) == 512); + /* Set default options */ + opt.status_fd = -1; + /* Parse the command line. */ pargs.argc = &argc; pargs.argv = &argv; @@ -522,7 +544,7 @@ main (int argc, char **argv) /* Read the next record from STREAM. RECORD is a buffer provided by - the caller and must be at leadt of size RECORDSIZE. The function + the caller and must be at least of size RECORDSIZE. The function return 0 on success and error code on failure; a diagnostic printed as well. Note that there is no need for an EOF indicator because a tarball has an explicit EOF record. */ |