[PATCH 0/3] Control notmuch show output
Mark Walters
markwalters1009 at gmail.com
Sat Jul 7 08:12:55 PDT 2012
This is a first draft of a patch set allowing the caller to control
the output of notmuch show. This option should subsume the
--headers-only option (see
id:"1341041595-5858-1-git-send-email-markwalters1009 at gmail.com") and
the reply-to patch
(id:"1340508470-16606-2-git-send-email-novalazy at gmail.com") as well as
being extensible.
It follows the suggestions made in
id:"20120704182459.GI2342 at hili.localdomain" and
id:"CAB+hUn_sxy=QP1+OzGwKOcSYGi13Q61m4-bq+PGnYxCMPd0fvg at mail.gmail.com"
and modifies the cli parser to allow keyword lists of the form --output=from,cc,body
The first patch adds this functionality to the option parser. It uses
a bitfield to pass the flags specified so we are limited to 32 (or
perhaps 31) possible options.
The second patch implements this for the selection of which headers to
return. Since notmuch-reply.c wanted exactly this functionality (since
it wants in-reply-to headers and reference headers but not the date
header) it is converted to use this style.
The third patch uses this functionality to implement the
--headers-only functionality by adding a "body" option to the list of
things the user can choose to output or not.
Currently, I have not written any tests for the new functionality,
updated the man page, or implemented for any format except JSON.
Do people have any comments in the current form?
Best wishes
Mark
Mark Walters (3):
cli: allow keyword lists in argument parser.
cli: show allow the caller to specify the headers output.
cli: allow show to omit message bodies.
command-line-arguments.c | 47 +++++++++++++++++++++++
command-line-arguments.h | 3 +-
notmuch-client.h | 26 ++++++++++++-
notmuch-reply.c | 12 +++++-
notmuch-show.c | 92 +++++++++++++++++++++++++++++++--------------
5 files changed, 146 insertions(+), 34 deletions(-)
--
1.7.9.1
More information about the notmuch
mailing list