Add flags to the getauditlog command.
This commit is contained in:
parent
dce41d1ffa
commit
c2ee84a87a
@ -1,5 +1,8 @@
|
||||
2009-12-01 Werner Koch <wk@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.
|
||||
|
@ -1897,6 +1897,11 @@ cmd_keylist (assuan_context_t ctx, char *line)
|
||||
}
|
||||
|
||||
|
||||
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 @@ cmd_getauditlog (assuan_context_t ctx, char *line)
|
||||
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,7 +1918,12 @@ cmd_getauditlog (assuan_context_t ctx, char *line)
|
||||
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 @@ register_commands (assuan_context_t ctx)
|
||||
{ "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 },
|
||||
|
Loading…
Reference in New Issue
Block a user