aboutsummaryrefslogtreecommitdiffstats
path: root/tools/gpgtar.c
diff options
context:
space:
mode:
Diffstat (limited to 'tools/gpgtar.c')
-rw-r--r--tools/gpgtar.c37
1 files changed, 21 insertions, 16 deletions
diff --git a/tools/gpgtar.c b/tools/gpgtar.c
index 2757ab011..b33aa6d0f 100644
--- a/tools/gpgtar.c
+++ b/tools/gpgtar.c
@@ -112,7 +112,7 @@ static ARGPARSE_OPTS opts[] = {
ARGPARSE_group (302, N_("@\nTar options:\n ")),
ARGPARSE_s_s (oDirectory, "directory",
- N_("|DIRECTORY|extract files into DIRECTORY")),
+ N_("|DIRECTORY|change to DIRECTORY first")),
ARGPARSE_s_s (oFilesFrom, "files-from",
N_("|FILE|get names to create from FILE")),
ARGPARSE_s_n (oNull, "null", N_("-T reads null-terminated names")),
@@ -136,6 +136,14 @@ static ARGPARSE_OPTS tar_opts[] = {
};
+/* Global flags. */
+enum cmd_and_opt_values cmd = 0;
+int skip_crypto = 0;
+const char *files_from = NULL;
+int null_names = 0;
+
+
+
/* Print usage information and provide strings for help. */
static const char *
@@ -169,23 +177,25 @@ my_strusage( int level )
static void
set_cmd (enum cmd_and_opt_values *ret_cmd, enum cmd_and_opt_values new_cmd)
{
- enum cmd_and_opt_values cmd = *ret_cmd;
-
- if (!cmd || cmd == new_cmd)
- cmd = new_cmd;
- else if (cmd == aSign && new_cmd == aEncrypt)
- cmd = aSignEncrypt;
- else if (cmd == aEncrypt && new_cmd == aSign)
- cmd = aSignEncrypt;
+ enum cmd_and_opt_values c = *ret_cmd;
+
+ if (!c || c == new_cmd)
+ c = new_cmd;
+ else if (c == aSign && new_cmd == aEncrypt)
+ c = aSignEncrypt;
+ else if (c == aEncrypt && new_cmd == aSign)
+ c = aSignEncrypt;
else
{
log_error (_("conflicting commands\n"));
exit (2);
}
- *ret_cmd = cmd;
+ *ret_cmd = c;
}
+
+
/* Shell-like argument splitting.
For compatibility with gpg-zip we accept arguments for GnuPG and
@@ -287,14 +297,9 @@ shell_parse_argv (const char *s, int *r_argc, char ***r_argv)
gpgrt_annotate_leaked_object (*r_argv);
return 0;
}
-
-/* Global flags. */
-enum cmd_and_opt_values cmd = 0;
-int skip_crypto = 0;
-const char *files_from = NULL;
-int null_names = 0;
+
/* Command line parsing. */
static void
parse_arguments (ARGPARSE_ARGS *pargs, ARGPARSE_OPTS *popts)