Mercurial > dovecot > core-2.2
changeset 20995:0e63d2333418
doveadm: "pager" formatter supports now DOVEADM_PRINT_HEADER_FLAG_HIDE_TITLE
author | Timo Sirainen <timo.sirainen@dovecot.fi> |
---|---|
date | Tue, 25 Oct 2016 20:51:36 +0300 |
parents | 9ac2b5223b9f |
children | 47c46aaa0e62 |
files | src/doveadm/doveadm-print-pager.c |
diffstat | 1 files changed, 10 insertions(+), 4 deletions(-) [+] |
line wrap: on
line diff
--- a/src/doveadm/doveadm-print-pager.c Thu Apr 21 14:22:10 2016 +0300 +++ b/src/doveadm/doveadm-print-pager.c Tue Oct 25 20:51:36 2016 +0300 @@ -7,6 +7,7 @@ struct doveadm_print_pager_header { const char *title; + enum doveadm_print_header_flags flags; }; struct doveadm_print_pager_context { @@ -26,6 +27,7 @@ struct doveadm_print_pager_header *fhdr; fhdr = array_append_space(&ctx->headers); + fhdr->flags = hdr->flags; fhdr->title = p_strdup(ctx->pool, hdr->title); } @@ -45,8 +47,10 @@ o_stream_nsend(doveadm_print_ostream, "\f\n", 2); } ctx->first_page = FALSE; - o_stream_nsend_str(doveadm_print_ostream, hdr->title); - o_stream_nsend(doveadm_print_ostream, ": ", 2); + if ((hdr->flags & DOVEADM_PRINT_HEADER_FLAG_HIDE_TITLE) == 0) { + o_stream_nsend_str(doveadm_print_ostream, hdr->title); + o_stream_nsend(doveadm_print_ostream, ": ", 2); + } o_stream_nsend_str(doveadm_print_ostream, value); o_stream_nsend(doveadm_print_ostream, "\n", 1); pager_next_hdr(); @@ -60,8 +64,10 @@ if (!ctx->streaming) { ctx->streaming = TRUE; - o_stream_nsend_str(doveadm_print_ostream, hdr->title); - o_stream_nsend(doveadm_print_ostream, ":\n", 2); + if ((hdr->flags & DOVEADM_PRINT_HEADER_FLAG_HIDE_TITLE) == 0) { + o_stream_nsend_str(doveadm_print_ostream, hdr->title); + o_stream_nsend(doveadm_print_ostream, ":\n", 2); + } } o_stream_nsend(doveadm_print_ostream, value, size); if (size == 0) {