mirror of
git://git.gnupg.org/gnupg.git
synced 2025-03-28 22:49:59 +01:00
gpgconf: Add limited support for -0.
* tools/gpgconf.h (opt): Add field 'null'. * tools/gpgconf.c: Add option --null/-0. (list_dirs): Use it here. -- This option changes the delimites for --list-dir with arguments from LF to Nul. Signed-off-by: Werner Koch <wk@gnupg.org>
This commit is contained in:
parent
05cb30052c
commit
db6f3eb926
@ -40,6 +40,7 @@ enum cmd_and_opt_values
|
|||||||
oVerbose = 'v',
|
oVerbose = 'v',
|
||||||
oRuntime = 'r',
|
oRuntime = 'r',
|
||||||
oComponent = 'c',
|
oComponent = 'c',
|
||||||
|
oNull = '0',
|
||||||
oNoVerbose = 500,
|
oNoVerbose = 500,
|
||||||
oHomedir,
|
oHomedir,
|
||||||
|
|
||||||
@ -93,6 +94,7 @@ static ARGPARSE_OPTS opts[] =
|
|||||||
{ oRuntime, "runtime", 0, N_("activate changes at runtime, if possible") },
|
{ oRuntime, "runtime", 0, N_("activate changes at runtime, if possible") },
|
||||||
/* hidden options */
|
/* hidden options */
|
||||||
{ oHomedir, "homedir", 2, "@" },
|
{ oHomedir, "homedir", 2, "@" },
|
||||||
|
{ oNull, "null", 0, "@" },
|
||||||
{ oNoVerbose, "no-verbose", 0, "@"},
|
{ oNoVerbose, "no-verbose", 0, "@"},
|
||||||
{0}
|
{0}
|
||||||
};
|
};
|
||||||
@ -197,7 +199,10 @@ list_dirs (estream_t fp, char **names)
|
|||||||
{
|
{
|
||||||
for (j=0; names[j]; j++)
|
for (j=0; names[j]; j++)
|
||||||
if (!strcmp (names[j], list[idx].name))
|
if (!strcmp (names[j], list[idx].name))
|
||||||
es_fprintf (fp, "%s\n", s);
|
{
|
||||||
|
es_fputs (s, fp);
|
||||||
|
es_putc (opt.null? '\0':'\n', fp);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
xfree (tmp);
|
xfree (tmp);
|
||||||
@ -241,6 +246,7 @@ main (int argc, char **argv)
|
|||||||
case oVerbose: opt.verbose++; break;
|
case oVerbose: opt.verbose++; break;
|
||||||
case oNoVerbose: opt.verbose = 0; break;
|
case oNoVerbose: opt.verbose = 0; break;
|
||||||
case oHomedir: gnupg_set_homedir (pargs.r.ret_str); break;
|
case oHomedir: gnupg_set_homedir (pargs.r.ret_str); break;
|
||||||
|
case oNull: opt.null = 1; break;
|
||||||
|
|
||||||
case aListDirs:
|
case aListDirs:
|
||||||
case aListComponents:
|
case aListComponents:
|
||||||
|
@ -29,6 +29,7 @@ struct
|
|||||||
int quiet; /* Be extra quiet. */
|
int quiet; /* Be extra quiet. */
|
||||||
int dry_run; /* Don't change any persistent data. */
|
int dry_run; /* Don't change any persistent data. */
|
||||||
int runtime; /* Make changes active at runtime. */
|
int runtime; /* Make changes active at runtime. */
|
||||||
|
int null; /* Option -0 active. */
|
||||||
char *outfile; /* Name of output file. */
|
char *outfile; /* Name of output file. */
|
||||||
|
|
||||||
int component; /* The active component. */
|
int component; /* The active component. */
|
||||||
|
Loading…
x
Reference in New Issue
Block a user