[svn] gpgme - r1415 - trunk/src
svn author wk
cvs at cvs.gnupg.org
Wed Nov 4 11:43:42 CET 2009
Author: wk
Date: 2009-11-04 11:43:42 +0100 (Wed, 04 Nov 2009)
New Revision: 1415
Modified:
trunk/src/ChangeLog
trunk/src/gpgme-tool.c
Log:
Adjust for changed assuan_register_command.
Modified: trunk/src/ChangeLog
===================================================================
--- trunk/src/ChangeLog 2009-11-03 20:27:35 UTC (rev 1414)
+++ trunk/src/ChangeLog 2009-11-04 10:43:42 UTC (rev 1415)
@@ -1,3 +1,7 @@
+2009-11-04 Werner Koch <wk at g10code.com>
+
+ * gpgme-tool.c (register_commands): Add HELP feature.
+
2009-11-03 Werner Koch <wk at g10code.com>
* gpgme.h.in (GPGME_PROTOCOL_UISERVER): New.
Modified: trunk/src/gpgme-tool.c
===================================================================
--- trunk/src/gpgme-tool.c 2009-11-03 20:27:35 UTC (rev 1414)
+++ trunk/src/gpgme-tool.c 2009-11-04 10:43:42 UTC (rev 1415)
@@ -1174,7 +1174,10 @@
return 0;
}
-
+static const char hlp_version[] =
+ "VERSION [<string>]\n"
+ "\n"
+ "Call the function gpgme_check_version.";
static gpg_error_t
cmd_version (assuan_context_t ctx, char *line)
{
@@ -1199,6 +1202,10 @@
}
+static const char hlp_protocol[] =
+ "PROTOCOL [<name>]\n"
+ "\n"
+ "With NAME, set the protocol. Without return the current protocol.";
static gpg_error_t
cmd_protocol (assuan_context_t ctx, char *line)
{
@@ -1911,13 +1918,14 @@
gpg_error_t err;
static struct {
const char *name;
- gpg_error_t (*handler)(assuan_context_t, char *line);
+ assuan_handler_t handler;
+ const char * const help;
} table[] = {
// RESET, BYE are implicit.
- { "VERSION", cmd_version },
+ { "VERSION", cmd_version, hlp_version },
// TODO: Set engine info.
{ "ENGINE", cmd_engine },
- { "PROTOCOL", cmd_protocol },
+ { "PROTOCOL", cmd_protocol, hlp_protocol },
{ "ARMOR", cmd_armor },
{ "TEXTMODE", cmd_textmode },
{ "INCLUDE_CERTS", cmd_include_certs },
@@ -1964,7 +1972,8 @@
for (idx = 0; table[idx].name; idx++)
{
- err = assuan_register_command (ctx, table[idx].name, table[idx].handler);
+ err = assuan_register_command (ctx, table[idx].name, table[idx].handler,
+ table[idx].help);
if (err)
return err;
}
More information about the Gnupg-commits
mailing list