From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mp0 ([2001:41d0:2:4a6f::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by ms11 with LMTPS id mM+uDOswp14IJwAA0tVLHw (envelope-from ) for ; Mon, 27 Apr 2020 19:22:19 +0000 Received: from aspmx1.migadu.com ([2001:41d0:2:4a6f::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by mp0 with LMTPS id aCeCNPIwp144EQAA1q6Kng (envelope-from ) for ; Mon, 27 Apr 2020 19:22:26 +0000 Received: from arlo.cworth.org (arlo.cworth.org [50.126.95.6]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits)) (No client certificate requested) by aspmx1.migadu.com (Postfix) with ESMTPS id A0F81941F0A for ; Mon, 27 Apr 2020 19:22:23 +0000 (UTC) Received: from localhost (localhost [127.0.0.1]) by arlo.cworth.org (Postfix) with ESMTP id A18A96DE0F22; Mon, 27 Apr 2020 12:22:17 -0700 (PDT) X-Virus-Scanned: Debian amavisd-new at cworth.org Received: from arlo.cworth.org ([127.0.0.1]) by localhost (arlo.cworth.org [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id 18GtS5U2Vszp; Mon, 27 Apr 2020 12:22:17 -0700 (PDT) Received: from arlo.cworth.org (localhost [IPv6:::1]) by arlo.cworth.org (Postfix) with ESMTP id 4C4416DE0EE3; Mon, 27 Apr 2020 12:22:16 -0700 (PDT) Received: from localhost (localhost [127.0.0.1]) by arlo.cworth.org (Postfix) with ESMTP id 6A19A6DE0EE3 for ; Mon, 27 Apr 2020 12:22:15 -0700 (PDT) X-Virus-Scanned: Debian amavisd-new at cworth.org Received: from arlo.cworth.org ([127.0.0.1]) by localhost (arlo.cworth.org [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id hshHQmdF4KeD for ; Mon, 27 Apr 2020 12:22:14 -0700 (PDT) Received: from mail-qk1-f178.google.com (mail-qk1-f178.google.com [209.85.222.178]) by arlo.cworth.org (Postfix) with ESMTPS id E5ACC6DE0197 for ; Mon, 27 Apr 2020 12:22:13 -0700 (PDT) Received: by mail-qk1-f178.google.com with SMTP id m67so19209511qke.12 for ; Mon, 27 Apr 2020 12:22:13 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc; bh=2U0wyb2tDoRTxdFVgyaRPkrALNzsFHkeZ1jTkq90G9Q=; b=SWaVnDpxFKGAmQf7utY8zkfWD1f8GPiwxrqt2lQMbk3eDzQzjbARH8Xk9PSYG9x1nD /SCHGc2KIclXcW8ghXALQ+DVMZySO0Uh+mgOvwhDpyJVCM0D3sWnB36Bv2Y5vkPH5f7E GSa6F3N6AMtL4z0TMG5nDkf3jFnrN76YjDl3+3fQ501g3MYzYKVUgqvh2EIzmGIrUc4m Eq86/qUQ9yA4RAmiKIZGdUl4jZNtVDyQIWd8fJ3HbiF7f9296arKZa+3aLyPdZMWljEK 61j78nxRLj9//q1Jb6KMqX4/+txN36W9cdqFQxzY/5h4OzZQ0+8KYUDf8+dbBjHs1OU3 +DIg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=2U0wyb2tDoRTxdFVgyaRPkrALNzsFHkeZ1jTkq90G9Q=; b=X4BQMDL0eHyS7Xg+YctKOQ2rGqYg0HR2Gzehw9flP6P6Tsqw2Ux2QAzTJablfS/vEy L/U4CcTx89kNeEXeOhTOXCMA1j+A7OZk+zn6J59t6A7T7LK9FqSk01cGtkG684fLbm/c YJ1rD9gILSAQINmpqT2kzt5ZZ+wmpHk3V9Ae37+LnFIGNe249YDBSblYtiW5QAgX3/gA aCZL6s6PTgXfD+yV5TK8R7wbLhPRBYAPheqOKQjWcU3sgGsJfGZ0bczh49DJeMPkI5TM 2slIJW6iD7/xJd+C+Kmbjx785YmaSojlxsEEIOM6azEV4g90ysH3tyhMfBiYSioZuLer 5AHQ== X-Gm-Message-State: AGi0PuYEcWq4Ze8o3bPbHyiGAehvWohr28gq88ue4O1WJ8IN6zo1MLIA WVQqImy45utnyadfkVuzyZdG1xiKQhoIGd4TxDY/uA== X-Google-Smtp-Source: APiQypK3WwgvrseYV7Or3q119V/jgVHPwHvv1f3E+QM1CV0I+FeNo0R6yANgL9N+YDZgQ0A2C++GOP8nYuL6DsaG7+Y= X-Received: by 2002:ae9:eb94:: with SMTP id b142mr24048073qkg.143.1588015332943; Mon, 27 Apr 2020 12:22:12 -0700 (PDT) MIME-Version: 1.0 References: <87imhk95oc.fsf@tethera.net> <87k120x0wh.fsf@fifthhorseman.net> In-Reply-To: From: Ciprian Dorin Craciun Date: Mon, 27 Apr 2020 22:21:36 +0300 Message-ID: Subject: Re: Inconsistencies in handling command flags: `--flag=value` different than `--flag value` To: Tomi Ollila X-BeenThere: notmuch@notmuchmail.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "Use and development of the notmuch mail system." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: notmuch@notmuchmail.org, Daniel Kahn Gillmor Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Errors-To: notmuch-bounces@notmuchmail.org Sender: "notmuch" X-Scanner: scn0 X-Spam-Score: 0.09 Authentication-Results: aspmx1.migadu.com; dkim=fail (body hash did not verify) header.d=gmail.com header.s=20161025 header.b=SWaVnDpx; dmarc=fail reason="SPF not aligned (relaxed)" header.from=gmail.com (policy=none); spf=pass (aspmx1.migadu.com: domain of notmuch-bounces@notmuchmail.org designates 50.126.95.6 as permitted sender) smtp.mailfrom=notmuch-bounces@notmuchmail.org X-Scan-Result: default: False [0.09 / 13.00]; GENERIC_REPUTATION(0.00)[-0.46309862091723]; TO_DN_SOME(0.00)[]; R_SPF_ALLOW(-0.20)[+a:c]; R_DKIM_REJECT(1.00)[gmail.com:s=20161025]; DWL_DNSWL_FAIL(0.00)[50.126.95.6:server fail]; FREEMAIL_FROM(0.00)[gmail.com]; IP_REPUTATION_HAM(0.00)[asn: 27017(-0.19), country: US(-0.00), ip: 50.126.95.6(-0.46)]; DKIM_TRACE(0.00)[gmail.com:-]; MX_GOOD(-0.50)[cached: notmuchmail.org]; MAILLIST(-0.20)[mailman]; MIME_TRACE(0.00)[0:+]; RCVD_TLS_LAST(0.00)[]; ASN(0.00)[asn:27017, ipnet:50.126.64.0/18, country:US]; TAGGED_FROM(0.00)[]; FROM_NEQ_ENVFROM(0.00)[cipriancraciun@gmail.com,notmuch-bounces@notmuchmail.org]; ARC_NA(0.00)[]; URIBL_BLOCKED(0.00)[notmuchmail.org:email,iki.fi:email]; FROM_HAS_DN(0.00)[]; RCPT_COUNT_THREE(0.00)[3]; MIME_GOOD(-0.10)[text/plain]; PREVIOUSLY_DELIVERED(0.00)[notmuch@notmuchmail.org]; HAS_LIST_UNSUB(-0.01)[]; DNSWL_BLOCKED(0.00)[50.126.95.6:from]; RCVD_COUNT_SEVEN(0.00)[8]; FORGED_SENDER_MAILLIST(0.00)[]; DMARC_POLICY_SOFTFAIL(0.10)[gmail.com : SPF not aligned (relaxed),none] X-TUID: R1RyQRxlddtR On Mon, Apr 27, 2020 at 9:21 PM Tomi Ollila wrote: > > On Mon 2020-04-27 14:53:07 -0300, David Bremner wrote: > >> Quoting notmuch(1) > >> > >> OPTION SYNTAX > >> All options accepting an argument can be used with '=' > >> or ':' as a separator. For the cases where it's not ambiguous > >> (in particular excluding boolean options), a space can also be > >> used. I definitively skipped over that warning, mainly because I was reading the man-page for the specific command (i.e. `notmuch-search`, etc.) that don't feature that warning. Please note that I understand "why" I get this behavior, and definitively I agree that it's my fault. However my initial report was intended to find a way that new users don't shoot themselves in the foot, especially since many will use `notmuch` from a script, and sometimes they don't thoroughly check the arguments passed by the user. > > Alternately, we could deprecate using whitespace for all options, > > produce explicit warnings to stderr when whitespace appears on the next > > was it so, that originally we did not support whitespace, but David > added that in some commit... >From a "correctness" point of view, this would be the best approach. However I think it could be too late to introduce it, and it would break too many integrations. > > release, remove the suggestion to use a whitespace separator from the > > documentation, and eventually phase it out entirely in some future > > release. > > Alternatively we could check that next arg is (case-insensitively) > (subset of) 'true', 'false', 'yes', 'no', '0', '1', 't', 'nil' > (but not tpyoes of these ;) and in that case have that as an option > value... This would be perhaps the best approach. However I don't think it would solve the issues for integrators that would not see these warnings in the logs, until it is too late. > ... would that work better for human user who just wants to be > fluent on command line -- frontends can then always use = and option > values... Perhaps there could be an additional option (either on the command line or in the configuration) that would apply "strict" checking, and not letting any other form except `--argument=value`, including the boolean flags, and failing loudly. I think this third option would enable much safer integrations. (BTW, this "strict" option could also apply to the parsing of the search terms, which most of the time are under the control of the end user.) Ciprian.