[svn] gpgme - r1435 - trunk/src
svn author wk
cvs at cvs.gnupg.org
Tue Dec 1 12:21:47 CET 2009
Author: wk
Date: 2009-12-01 12:21:47 +0100 (Tue, 01 Dec 2009)
New Revision: 1435
Modified:
trunk/src/ChangeLog
trunk/src/gpgme-tool.c
Log:
Add flags to the getauditlog command.
Modified: trunk/src/ChangeLog
===================================================================
--- trunk/src/ChangeLog 2009-12-01 11:00:27 UTC (rev 1434)
+++ trunk/src/ChangeLog 2009-12-01 11:21:47 UTC (rev 1435)
@@ -1,5 +1,8 @@
2009-12-01 Werner Koch <wk at g10code.com>
+ * gpgme-tool.c (cmd_getauditlog): Add flag --html.
+ (hlp_getauditlog): New.
+
* gpgme-tool.c (GT_GCC_A_SENTINEL, GT_GCC_A_PRINTF): New.
(gt_write_status): Use sentinel.
(argp_error, log_error): Use printf attribute.
Modified: trunk/src/gpgme-tool.c
===================================================================
--- trunk/src/gpgme-tool.c 2009-12-01 11:00:27 UTC (rev 1434)
+++ trunk/src/gpgme-tool.c 2009-12-01 11:21:47 UTC (rev 1435)
@@ -565,8 +565,8 @@
err = gpgme_new (ctx);
if (err)
return err;
- gpgme_set_progress_cb (*ctx, _gt_progress_cb, gt);
- return 0;
+ gpgme_set_progress_cb (*ctx, _gt_progress_cb, gt);
+ return 0;
}
@@ -1897,6 +1897,11 @@
}
+static const char hlp_getauditlog[] =
+ "GETAUDITLOG [--html] [--with-help]\n"
+ "\n"
+ "Call the function gpgme_op_getauditlog with the given flags. Write\n"
+ "the output to the object set by the last OUTPUT command.";
static gpg_error_t
cmd_getauditlog (assuan_context_t ctx, char *line)
{
@@ -1904,6 +1909,7 @@
gpg_error_t err;
assuan_fd_t out_fd;
gpgme_data_t out_data;
+ unsigned int flags = 0;
out_fd = assuan_get_output_fd (ctx);
if (out_fd == ASSUAN_INVALID_FD)
@@ -1912,8 +1918,13 @@
if (err)
return err;
- err = gt_getauditlog (server->gt, out_data, 0);
+ if (strstr (line, "--html"))
+ flags |= GPGME_AUDITLOG_HTML;
+ if (strstr (line, "--with-help"))
+ flags |= GPGME_AUDITLOG_WITH_HELP;
+ err = gt_getauditlog (server->gt, out_data, flags);
+
gpgme_data_release (out_data);
server_reset_fds (server);
@@ -2054,7 +2065,7 @@
{ "KEYLIST", cmd_keylist },
{ "LISTKEYS", cmd_keylist },
// TODO: TRUSTLIST, TRUSTLIST_EXT
- { "GETAUDITLOG", cmd_getauditlog },
+ { "GETAUDITLOG", cmd_getauditlog, hlp_getauditlog },
// TODO: ASSUAN
{ "VFS_MOUNT", cmd_vfs_mount },
{ "MOUNT", cmd_vfs_mount },
More information about the Gnupg-commits
mailing list