[svn] GnuPG - r4575 - in trunk: doc tools
svn author wk
cvs at cvs.gnupg.org
Fri Aug 31 10:25:22 CEST 2007
Author: wk
Date: 2007-08-31 10:24:52 +0200 (Fri, 31 Aug 2007)
New Revision: 4575
Modified:
trunk/doc/tools.texi
trunk/tools/ChangeLog
trunk/tools/gpgconf-comp.c
Log:
Make gpgconf --list-components also print the name of the executable program.
Modified: trunk/doc/tools.texi
===================================================================
--- trunk/doc/tools.texi 2007-08-29 16:59:20 UTC (rev 4574)
+++ trunk/doc/tools.texi 2007-08-31 08:24:52 UTC (rev 4575)
@@ -421,7 +421,7 @@
The command argument @code{--list-components} lists all available
components, one per line. The format of each line is:
- at code{@var{name}:@var{description}}
+ at code{@var{name}:@var{description}:@var{pgmname}:}
@table @var
@item name
@@ -435,16 +435,21 @@
of the component. It can be displayed to the user of the GUI for
informational purposes. It is @emph{percent-escaped} and
@emph{localized}.
+
+ at item pgmname
+The @emph{string} in this field contains the absolute name of the
+program's file. It can be used to unambiguously invoke that program.
+It is @emph{percent-escaped}.
@end table
Example:
@example
$ gpgconf --list-components
-gpg:GPG for OpenPGP
-gpg-agent:GPG Agent
-scdaemon:Smartcard Daemon
-gpgsm:GPG for S/MIME
-dirmngr:Directory Manager
+gpg:GPG for OpenPGP:/usr/local/bin/gpg2:
+gpg-agent:GPG Agent:/usr/local/bin/gpg-agent:
+scdaemon:Smartcard Daemon:/usr/local/bin/scdaemon:
+gpgsm:GPG for S/MIME:/usr/local/bin/gpgsm:
+dirmngr:Directory Manager:/usr/local/bin/dirmngr:
@end example
Modified: trunk/tools/ChangeLog
===================================================================
--- trunk/tools/ChangeLog 2007-08-29 16:59:20 UTC (rev 4574)
+++ trunk/tools/ChangeLog 2007-08-31 08:24:52 UTC (rev 4575)
@@ -1,3 +1,8 @@
+2007-08-31 Werner Koch <wk at g10code.com>
+
+ * gpgconf-comp.c (gc_component_list_components): List the programs
+ names.
+
2007-08-29 Werner Koch <wk at g10code.com>
* gpgconf.c: New command --check-programs.
Modified: trunk/tools/gpgconf-comp.c
===================================================================
--- trunk/tools/gpgconf-comp.c 2007-08-29 16:59:20 UTC (rev 4574)
+++ trunk/tools/gpgconf-comp.c 2007-08-31 08:24:52 UTC (rev 4575)
@@ -1142,16 +1142,43 @@
void
gc_component_list_components (FILE *out)
{
- gc_component_t idx;
+ gc_component_t component;
+ gc_option_t *option;
+ gc_backend_t backend;
+ int backend_seen[GC_BACKEND_NR];
+ const char *desc;
+ const char *pgmname;
- for (idx = 0; idx < GC_COMPONENT_NR; idx++)
+ for (component = 0; component < GC_COMPONENT_NR; component++)
{
- if (gc_component[idx].options)
+ option = gc_component[component].options;
+ if (option)
{
- const char *desc = gc_component[idx].desc;
- desc = my_dgettext (gc_component[idx].desc_domain, desc);
- fprintf (out, "%s:%s\n",
- gc_component[idx].name, my_percent_escape (desc));
+ for (backend = 0; backend < GC_BACKEND_NR; backend++)
+ backend_seen[backend] = 0;
+
+ pgmname = "";
+ for (; option && option->name; option++)
+ {
+ if ((option->flags & GC_OPT_FLAG_GROUP))
+ continue;
+ backend = option->backend;
+ if (backend_seen[backend])
+ continue;
+ backend_seen[backend] = 1;
+ assert (backend != GC_BACKEND_ANY);
+ if (gc_backend[backend].program
+ && !gc_backend[backend].module_name)
+ continue;
+ pgmname = gnupg_module_name (gc_backend[backend].module_name);
+ break;
+ }
+
+ desc = gc_component[component].desc;
+ desc = my_dgettext (gc_component[component].desc_domain, desc);
+ fprintf (out, "%s:%s:",
+ gc_component[component].name, my_percent_escape (desc));
+ fprintf (out, "%s:\n", my_percent_escape (pgmname));
}
}
}
More information about the Gnupg-commits
mailing list