--- /dev/null
+Return-Path: <jani@nikula.org>\r
+X-Original-To: notmuch@notmuchmail.org\r
+Delivered-To: notmuch@notmuchmail.org\r
+Received: from localhost (localhost [127.0.0.1])\r
+ by olra.theworths.org (Postfix) with ESMTP id 13A18431FCB\r
+ for <notmuch@notmuchmail.org>; Sun, 18 Aug 2013 04:25:29 -0700 (PDT)\r
+X-Virus-Scanned: Debian amavisd-new at olra.theworths.org\r
+X-Spam-Flag: NO\r
+X-Spam-Score: -0.7\r
+X-Spam-Level: \r
+X-Spam-Status: No, score=-0.7 tagged_above=-999 required=5\r
+ tests=[RCVD_IN_DNSWL_LOW=-0.7] autolearn=disabled\r
+Received: from olra.theworths.org ([127.0.0.1])\r
+ by localhost (olra.theworths.org [127.0.0.1]) (amavisd-new, port 10024)\r
+ with ESMTP id 9o8F7SyBfnQd for <notmuch@notmuchmail.org>;\r
+ Sun, 18 Aug 2013 04:25:19 -0700 (PDT)\r
+Received: from mail-bk0-f42.google.com (mail-bk0-f42.google.com\r
+ [209.85.214.42]) (using TLSv1 with cipher RC4-SHA (128/128 bits))\r
+ (No client certificate requested)\r
+ by olra.theworths.org (Postfix) with ESMTPS id 84784431FBC\r
+ for <notmuch@notmuchmail.org>; Sun, 18 Aug 2013 04:25:19 -0700 (PDT)\r
+Received: by mail-bk0-f42.google.com with SMTP id my10so1152231bkb.29\r
+ for <notmuch@notmuchmail.org>; Sun, 18 Aug 2013 04:25:18 -0700 (PDT)\r
+X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;\r
+ d=google.com; s=20120113;\r
+ h=x-gm-message-state:from:to:subject:in-reply-to:references\r
+ :user-agent:date:message-id:mime-version:content-type;\r
+ bh=US38LWj78PjN37Zd1UVmXpkSAIzaXlWFaOWGWbCPZ0Q=;\r
+ b=Yy54RzY3D55keEVf37KlEWJVJLd2L5kTdjyFiw4Hvjlk9C4ct60B2cxTj8VO7C6HiC\r
+ 3X7cBPeMb1WUkz4u1C4AFyaFrYi3QGNwNHQUzGg+YxZA82q16LKp+C3IPXU88l2/2yrL\r
+ RjRAhsJRV159OLpxKROIuHk3/+8SaHT3faCx+LpLD/+NseIGlznkTDIv01zvKPVBsbb+\r
+ SPKka/K5bHtAC4RyyT7Bm9710qU9Hje3EPpOmrvoMUBRjvpLDWzSkIQiFMnGzxqNeA3q\r
+ Vmi7oUyImaCki68aImHFs1FGGK9VIGZTOinyDVhQvZjkZhMJ3E8Am1L2MkbQFthlmLNZ\r
+ JuTA==\r
+X-Gm-Message-State:\r
+ ALoCoQlbZWfSB07afBb4efVY5MD6HXtEqtF+gX3pVYFzB0UTxTIkEt78Bm4jZWcm+y2LQa931fHA\r
+X-Received: by 10.204.173.196 with SMTP id q4mr4293544bkz.9.1376825115571;\r
+ Sun, 18 Aug 2013 04:25:15 -0700 (PDT)\r
+Received: from localhost (dsl-hkibrasgw2-58c36f-91.dhcp.inet.fi.\r
+ [88.195.111.91])\r
+ by mx.google.com with ESMTPSA id h7sm636208bki.9.1969.12.31.16.00.00\r
+ (version=TLSv1.2 cipher=RC4-SHA bits=128/128);\r
+ Sun, 18 Aug 2013 04:25:14 -0700 (PDT)\r
+From: Jani Nikula <jani@nikula.org>\r
+To: John Lenz <lenz@math.uic.edu>, Tomi Ollila <tomi.ollila@iki.fi>,\r
+ notmuch@notmuchmail.org\r
+Subject: Re: cli: add --include-html option to notmuch show\r
+In-Reply-To: <notmuch-web-1376754748.336647450@www.wuzzeb.org>\r
+References: <notmuch-web-1372724382.450184839@www.wuzzeb.org>\r
+ <m27ggj1x29.fsf@guru.guru-group.fi>\r
+ <notmuch-web-1374719771.1588310986@www.wuzzeb.org>\r
+ <m2zjsxs0g1.fsf@guru.guru-group.fi>\r
+ <notmuch-web-1376754748.336647450@www.wuzzeb.org>\r
+User-Agent: Notmuch/0.15.2+227~g40b2846 (http://notmuchmail.org) Emacs/24.3.1\r
+ (x86_64-pc-linux-gnu)\r
+Date: Sun, 18 Aug 2013 14:25:16 +0300\r
+Message-ID: <87k3jjutpf.fsf@nikula.org>\r
+MIME-Version: 1.0\r
+Content-Type: text/plain\r
+X-BeenThere: notmuch@notmuchmail.org\r
+X-Mailman-Version: 2.1.13\r
+Precedence: list\r
+List-Id: "Use and development of the notmuch mail system."\r
+ <notmuch.notmuchmail.org>\r
+List-Unsubscribe: <http://notmuchmail.org/mailman/options/notmuch>,\r
+ <mailto:notmuch-request@notmuchmail.org?subject=unsubscribe>\r
+List-Archive: <http://notmuchmail.org/pipermail/notmuch>\r
+List-Post: <mailto:notmuch@notmuchmail.org>\r
+List-Help: <mailto:notmuch-request@notmuchmail.org?subject=help>\r
+List-Subscribe: <http://notmuchmail.org/mailman/listinfo/notmuch>,\r
+ <mailto:notmuch-request@notmuchmail.org?subject=subscribe>\r
+X-List-Received-Date: Sun, 18 Aug 2013 11:25:29 -0000\r
+\r
+On Sat, 17 Aug 2013, John Lenz <lenz@math.uic.edu> wrote:\r
+> On Sun Aug 4 14:47 -0500 2013, Tomi Ollila <tomi.ollila@iki.fi> wrote:\r
+>> The next question is should we have new option as\r
+>> \r
+>> --include-html\r
+>> \r
+>> or as\r
+>> \r
+>> --include-html=(true|false)\r
+>> \r
+>> or even\r
+>> \r
+>> --body=(true|false|text-and-html)\r
+>> \r
+>> See --exclude option in http://notmuchmail.org/manpages/notmuch-search-1/\r
+>> and --body option in http://notmuchmail.org/manpages/notmuch-show-1/\r
+>> for comparison...\r
+>> \r
+>\r
+> I have no preference here, although I guess I would vote for\r
+> --include-html=(true|false) since adding it to --body makes the --body\r
+> options confusing: to make sense the body options should be\r
+> --body=(text|text-and-html|none) but of course you can't change that and\r
+> break the command line API. Well, maybe you could add all three\r
+> --body=(text|text-and-html|none) and still accept true/false for\r
+> compatibility.\r
+\r
+Hi John & Tomi -\r
+\r
+We could trivially amend the argument parser to |= the keyword values\r
+(instead of =) to allow specifying keywords arguments multiple times on\r
+the command line. With the keyword values specified as bit flags, we\r
+could then have 'notmuch show --body=text --body=html ...' return both\r
+text and html, and allow trivial future extension too.\r
+\r
+--body=true and --body=false could be handled specially for backwards\r
+compatibility, for example by forcing text only or no parts,\r
+respectively. Since the default is currently text, --body=none might be\r
+a suitable synonym for --body=false, while the boolean alternatives\r
+could be deprecated.\r
+\r
+A little less trivially it's also possible to support e.g. comma\r
+separated keyword values, such as --body=text,html but I do prefer the\r
+(implementation) simplicity of the above.\r
+\r
+Untested patch to the argument parser below.\r
+\r
+Cheers,\r
+Jani.\r
+\r
+\r
+diff --git a/command-line-arguments.c b/command-line-arguments.c\r
+index bf9aeca..c426054 100644\r
+--- a/command-line-arguments.c\r
++++ b/command-line-arguments.c\r
+@@ -23,7 +23,10 @@ _process_keyword_arg (const notmuch_opt_desc_t *arg_desc, char next, const char\r
+ while (keywords->name) {\r
+ if (strcmp (arg_str, keywords->name) == 0) {\r
+ if (arg_desc->output_var) {\r
+- *((int *)arg_desc->output_var) = keywords->value;\r
++ if (arg_desc->opt_type == NOTMUCH_OPT_KEYWORD_FLAGS)\r
++ *((int *)arg_desc->output_var) |= keywords->value;\r
++ else\r
++ *((int *)arg_desc->output_var) = keywords->value;\r
+ }\r
+ return TRUE;\r
+ }\r
+@@ -146,6 +149,7 @@ parse_option (const char *arg,\r
+ \r
+ switch (try->opt_type) {\r
+ case NOTMUCH_OPT_KEYWORD:\r
++ case NOTMUCH_OPT_KEYWORD_FLAGS:\r
+ return _process_keyword_arg (try, next, value);\r
+ break;\r
+ case NOTMUCH_OPT_BOOLEAN:\r
+diff --git a/command-line-arguments.h b/command-line-arguments.h\r
+index de1734a..085a492 100644\r
+--- a/command-line-arguments.h\r
++++ b/command-line-arguments.h\r
+@@ -8,6 +8,7 @@ enum notmuch_opt_type {\r
+ NOTMUCH_OPT_BOOLEAN, /* --verbose */\r
+ NOTMUCH_OPT_INT, /* --frob=8 */\r
+ NOTMUCH_OPT_KEYWORD, /* --format=raw|json|text */\r
++ NOTMUCH_OPT_KEYWORD_FLAGS, /* the above with values OR'd together */\r
+ NOTMUCH_OPT_STRING, /* --file=/tmp/gnarf.txt */\r
+ NOTMUCH_OPT_POSITION /* notmuch dump pos_arg */\r
+ };\r
+\r
+\r
+\r