From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from localhost (localhost [127.0.0.1]) by olra.theworths.org (Postfix) with ESMTP id 44292431FAF for ; Tue, 13 Mar 2012 19:47:18 -0700 (PDT) X-Virus-Scanned: Debian amavisd-new at olra.theworths.org X-Spam-Flag: NO X-Spam-Score: -0.7 X-Spam-Level: X-Spam-Status: No, score=-0.7 tagged_above=-999 required=5 tests=[RCVD_IN_DNSWL_LOW=-0.7] autolearn=disabled Received: from olra.theworths.org ([127.0.0.1]) by localhost (olra.theworths.org [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id WLcnNozfva6h for ; Tue, 13 Mar 2012 19:47:17 -0700 (PDT) Received: from dmz-mailsec-scanner-3.mit.edu (DMZ-MAILSEC-SCANNER-3.MIT.EDU [18.9.25.14]) by olra.theworths.org (Postfix) with ESMTP id C24F7431FAE for ; Tue, 13 Mar 2012 19:47:17 -0700 (PDT) X-AuditID: 1209190e-b7f7c6d0000008c3-47-4f6006b5703a Received: from mailhub-auth-3.mit.edu ( [18.9.21.43]) by dmz-mailsec-scanner-3.mit.edu (Symantec Messaging Gateway) with SMTP id 46.03.02243.5B6006F4; Tue, 13 Mar 2012 22:47:17 -0400 (EDT) Received: from outgoing.mit.edu (OUTGOING-AUTH.MIT.EDU [18.7.22.103]) by mailhub-auth-3.mit.edu (8.13.8/8.9.2) with ESMTP id q2E2lHmi020042; Tue, 13 Mar 2012 22:47:17 -0400 Received: from awakening.csail.mit.edu (awakening.csail.mit.edu [18.26.4.91]) (authenticated bits=0) (User authenticated as amdragon@ATHENA.MIT.EDU) by outgoing.mit.edu (8.13.6/8.12.4) with ESMTP id q2E2lGle026400 (version=TLSv1/SSLv3 cipher=AES256-SHA bits=256 verify=NOT); Tue, 13 Mar 2012 22:47:16 -0400 (EDT) Received: from amthrax by awakening.csail.mit.edu with local (Exim 4.77) (envelope-from ) id 1S7eFA-0005wS-1o; Tue, 13 Mar 2012 22:47:16 -0400 Date: Tue, 13 Mar 2012 22:47:16 -0400 From: Austin Clements To: Mark Walters Subject: Re: [PATCH v2 0/2] cli: Allow true/false parameter for boolean Message-ID: <20120314024716.GL2787@mit.edu> References: <1331377533-30262-1-git-send-email-markwalters1009@gmail.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <1331377533-30262-1-git-send-email-markwalters1009@gmail.com> User-Agent: Mutt/1.5.21 (2010-09-15) X-Brightmail-Tracker: H4sIAAAAAAAAA+NgFmpkleLIzCtJLcpLzFFi42IR4hTV1t3KluBv8Pa9jMXquTwW12/OZHZg 8tg56y67x7NVt5gDmKK4bFJSczLLUov07RK4MiY17mMv+MlTcWH2V/YGxh+cXYycHBICJhL3 d/1lh7DFJC7cW8/WxcjFISSwj1Fi1vbLYAkhgQ2MEtcOC0PYJ5kk1i8phShawiixYvVkFpAE i4CqxKV175hBbDYBDYlt+5czgtgiAjoStw8tABvELCAt8e13MxOILSzgLvFu0lywGl4BbYnz c5YxQyzwlDjztIcFIi4ocXLmExaIXi2JG/9eAvVygM1Z/o8DJMwp4CUx9dEFsBJRARWJKSe3 sU1gFJqFpHsWku5ZCN0LGJlXMcqm5Fbp5iZm5hSnJusWJyfm5aUW6Rrr5WaW6KWmlG5iBIe0 JN8Oxq8HlQ4xCnAwKvHwCtfG+wuxJpYVV+YeYpTkYFIS5Y18CxTiS8pPqcxILM6ILyrNSS0+ xCjBwawkwvtiKlCONyWxsiq1KB8mJc3BoiTOq6b1zk9IID2xJDU7NbUgtQgmK8PBoSTBqwIy VLAoNT21Ii0zpwQhzcTBCTKcB2h4+XeQ4cUFibnFmekQ+VOMilLivHfeACUEQBIZpXlwvbCU 84pRHOgVYd6VIFU8wHQF1/0KaDAT0OCSb3Egg0sSEVJSDYzlHz68ylLVs53/e9MZa5NEw2/R 7DO06krLJWyZPH2Y6zSXKq05vjy7PU90wuae3V7m9+6tmXpDh3V7+CnNa0q8/+e+WbrvkYDJ ze9R1QIb723W5JX1bquofStx9XLRwk83tzAnzbgy44rV9/yYj60XXkbc4H94TUf+i/3WXE2+ m89fn/68JmC3EktxRqKhFnNRcSIANjYZ+xQDAAA= Cc: notmuch@notmuchmail.org X-BeenThere: notmuch@notmuchmail.org X-Mailman-Version: 2.1.13 Precedence: list List-Id: "Use and development of the notmuch mail system." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 14 Mar 2012 02:47:18 -0000 Quoth Mark Walters on Mar 10 at 11:05 am: > Hi > > Here is a second version of a patch to allow parameters to boolean > options on the command line. This version allows parameters > (=true|false). My first version is at > id:"1331244944-7960-1-git-send-email-markwalters1009@gmail.com". Jani > posted an alternative version there. Jani's version and this one are > quite similar: the key difference is that this version abuses a > notmuch_bool_t by setting it to -1 (to indicate that the parser has > not set this option). This makes the code simpler but is definitely an > abuse. I will discuss this further in replies to Jani's series. > > Best wishes > > Mark > > Mark Walters (2): > cli: Parsing. Allow true/false parameter for boolean options. > cli: make --entire-thread=false work for format=json. LGTM. The one question I have is whether or not the resulting non-entire-thread behavior of the JSON format is actually what we *want*. As a probably unintentional consequence of the current show code, we get # A message and its replies (show_messages) thread_node = [ message?, # present if --entire-thread or matched [thread_node*] # children of message ] But would it be better to have thread_node = [ message|null, # non-null if --entire-thread or matched [thread_node*] # children of message ] ? The latter is much more natural for consumers to work with (checking whether the message matched or not is more natural and the index of the child list doesn't change), but would require a little more code in show to support.