From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mp1 ([2001:41d0:2:4a6f::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by ms11 with LMTPS id YGciOTOmqV6IXgAA0tVLHw (envelope-from ) for ; Wed, 29 Apr 2020 16:07:15 +0000 Received: from aspmx1.migadu.com ([2001:41d0:2:4a6f::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by mp1 with LMTPS id geDKBT2mqV5oMQAAbx9fmQ (envelope-from ) for ; Wed, 29 Apr 2020 16:07:25 +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 8CF4394060C for ; Wed, 29 Apr 2020 16:07:22 +0000 (UTC) Received: from localhost (localhost [127.0.0.1]) by arlo.cworth.org (Postfix) with ESMTP id 67D2B6DE101A; Wed, 29 Apr 2020 09:07:20 -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 bNDHMJn7DfgD; Wed, 29 Apr 2020 09:07:19 -0700 (PDT) Received: from arlo.cworth.org (localhost [IPv6:::1]) by arlo.cworth.org (Postfix) with ESMTP id 20B1B6DE10AD; Wed, 29 Apr 2020 09:07:19 -0700 (PDT) Received: from localhost (localhost [127.0.0.1]) by arlo.cworth.org (Postfix) with ESMTP id EEA4A6DE10AD for ; Wed, 29 Apr 2020 09:07: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 TWpd3g9ASzGq for ; Wed, 29 Apr 2020 09:07:17 -0700 (PDT) Received: from NAM10-DM6-obe.outbound.protection.outlook.com (mail-dm6nam10on2067.outbound.protection.outlook.com [40.107.93.67]) by arlo.cworth.org (Postfix) with ESMTPS id 4640F6DE101A for ; Wed, 29 Apr 2020 09:07:17 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=EShZo40fzxIyxy4CyUawaLN33oPKlBLxmfYJ5plkzvnAR6ci9ACNM/5BuU+fNrvVQZ8a4DWS0hGBEWSic5xBBp/iXqbR/eLEu6jMvXhaqUyTMr4ssrD5R4wX3zfk5oPUP8QuyKJtkkPJylpQcX3eeX+JUAsKi3a2oBYfEcxN14Vx2vRWL31yQRmX8zB4ubGKfR5EJMSbpu5zS4RIhtEmrlBVxaYntp2Zuf/2baGV052wrwDuYqStH9AT31K/n8fMeuuVj7n1YhSasANjApNecuZodwKdebUslQJrd1Ds9c23V/PO3i8PKGufEbiL/dV3ep//muFxqElunWpXF7311A== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector9901; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=lT1J9eIAa6csh/JdJkGcVd/A/cMFWTUM25OuQyQ/GhQ=; b=LAHYA/YSPY4RX3cJa/9dtwHpEBVD9XBDOmo27fbJ3/kD/U8WVZf5uzYxb7MpgaJrqElO3DZtcuDO5b7tNnN/QF+2IhIxdVn1WQcQ5RSTQzbHNTIpz9zhPBPHNMlZXo+0xy1Kq+O0emuXrplJj5z0vF8ZJFLP4oD48ZCsVDDXmxnv+jrCfgTI1O98uJJn4uA+/vQW7cvmI9Wst991bURHTnmnc1BFiy+KQ4XI0A3Vs++bbbCObtzimkzdI1PvcFLKLARp0F0xYm6EiqUmZd+j4tesM1ZC696iW4410v+sGJWjI7U0NIFt//3wpyufhlnyyl5Tjhd8/mpDW86nxwzPmw== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=caltech.edu; dmarc=pass action=none header.from=caltech.edu; dkim=pass header.d=caltech.edu; arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=caltech.edu; s=selector2; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=lT1J9eIAa6csh/JdJkGcVd/A/cMFWTUM25OuQyQ/GhQ=; b=B1vwj8wRaxQ3zk6oUlxghzWfrD0hJlcWBzoi18STsknxhzvOx4QZQ1z71BZBBFl5ZGD7Nqt0hE2WsuR3JW4yul+mqc+oG8+anCbDM1KCW8JnzRrTrzZc22azFaTAssdq4W35j/eGdbso6F+GlXA8voESt8K5UGNzBhbXLBofMLw= Authentication-Results: fifthhorseman.net; dkim=none (message not signed) header.d=none;fifthhorseman.net; dmarc=none action=none header.from=caltech.edu; Received: from servo.finestructure.net (76.91.54.61) by DM6PR03MB4603.namprd03.prod.outlook.com (2603:10b6:5:15c::16) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.2958.19; Wed, 29 Apr 2020 16:07:15 +0000 Received: by servo.finestructure.net (Postfix, from userid 1000) id 365DF142; Wed, 29 Apr 2020 09:07:12 -0700 (PDT) From: Jameson Graef Rollins To: Ciprian Dorin Craciun , David Bremner Subject: Re: Inconsistencies in handling command flags: `--flag=value` different than `--flag value` In-Reply-To: References: <87imhk95oc.fsf@tethera.net> <87k120x0wh.fsf@fifthhorseman.net> <87blnbvxx4.fsf@fifthhorseman.net> <87pnbql2sg.fsf@tethera.net> User-Agent: Notmuch/0.29.3 (https://notmuchmail.org) Emacs/26.1 (x86_64-pc-linux-gnu) Date: Wed, 29 Apr 2020 09:07:12 -0700 Message-ID: <87v9limg27.fsf@caltech.edu> MIME-Version: 1.0 X-Originating-IP: [76.91.54.61] X-ClientProxiedBy: BYAPR07CA0028.namprd07.prod.outlook.com (2603:10b6:a02:bc::41) To DM6PR03MB4603.namprd03.prod.outlook.com (2603:10b6:5:15c::16) X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: 6a65bb62-a163-4118-0ae0-08d7ec576294 X-MS-TrafficTypeDiagnostic: DM6PR03MB4603: X-Microsoft-Antispam-PRVS: X-MS-Oob-TLC-OOBClassifiers: OLM:10000; X-Forefront-PRVS: 03883BD916 X-MS-Exchange-SenderADCheck: 1 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: 0YTY1pS7RI7KO/JaWAHHVXv06Xq/GcO4JdYeiB2Pn/JQ/kSb72JiVjszHy55V5oPQAbp1z6k+vElFWDB+Jr6w3xsz03NOsVT81v7JQmmCNNPIbOs9kR/1wu7V2MF87Gs6dgBz2PXbfgaHpFO6WQRBPqgF3K9T7+SMVYkiRucDVnIypsOM0r6xSygpKDwQ3GM/KIU9JLqO/J3A6f+dmOimkZHe+CPfeGBFlLMC6zWdTcut5l0osVR0XTsiEkk3NkJyJfDGE8DTkN1NVizc2Hu7ooB8gTkkFpWbdNLrVj70Ns+bAupS4/Gvuaw9vE2QMaE33GLeL5nGsTpVeKO527WFFl+fnKbagVxuCWROmk8uNStcJrujgnn0ZxWIh95ZvDuMtQX/bfvghT2C70e7Gkkvpcte5iDaVH9To9I37PRHdey2xGPuqO+bzvy3oSwIzI8JIttIgLexptxTlowT6Yc6wDmX3XsVnKI9lyOS9V38Sdndmf62SC7uu9eb37o0csw X-Forefront-Antispam-Report: CIP:255.255.255.255; CTRY:; LANG:en; SCL:1; SRV:; IPV:NLI; SFV:NSPM; H:servo.finestructure.net; PTR:; CAT:NONE; SFTY:; SFS:(39860400002)(396003)(376002)(136003)(346002)(26005)(70586007)(66946007)(8936002)(5660300002)(8676002)(2906002)(36756003)(478600001)(86362001)(186003)(4326008)(316002)(110136005)(42186006)(786003)(75432002)(6266002)(2616005)(81973001); DIR:OUT; SFP:1101; X-MS-Exchange-AntiSpam-MessageData: AwYRh3lQb9dqNNvT9X9ZDIigAypsPdh7FHUGn0XdN1nxxzaqKs/LSydSknnI9S1ckX3gbhIuNGqwxKyeRLH1DXYuXtQRuV+hR1aIqMbemnoVRmeqfKuK5Eez6n6yH9+J2w63Ov7tB4wszAPsK1sblw== X-OriginatorOrg: caltech.edu X-MS-Exchange-CrossTenant-OriginalArrivalTime: 29 Apr 2020 16:07:15.5634 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: 6a65bb62-a163-4118-0ae0-08d7ec576294 X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-CrossTenant-Id: fd5be9d9-7b72-4df9-830e-b1f9cc5b44bd X-MS-Exchange-Transport-CrossTenantHeadersStamped: DM6PR03MB4603 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: 3.49 Authentication-Results: aspmx1.migadu.com; dkim=fail (body hash did not verify) header.d=caltech.edu header.s=selector2 header.b=B1vwj8wR; dmarc=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 [3.49 / 13.00]; FORGED_SENDER_MAILLIST(0.00)[]; GENERIC_REPUTATION(0.00)[-0.46236541433269]; HAS_XOIP(0.00)[]; TO_DN_SOME(0.00)[]; R_SPF_ALLOW(-0.20)[+a:c]; R_DKIM_REJECT(1.00)[caltech.edu:s=selector2]; DWL_DNSWL_FAIL(0.00)[50.126.95.6:server fail]; IP_REPUTATION_HAM(0.00)[asn: 27017(-0.18), country: US(-0.00), ip: 50.126.95.6(-0.46)]; ARC_REJECT(2.00)[signature check failed: fail, {[1] = sig:microsoft.com:reject}]; DKIM_TRACE(0.00)[caltech.edu:-]; MX_GOOD(-0.50)[cached: notmuchmail.org]; MAILLIST(-0.20)[mailman]; FREEMAIL_TO(0.00)[gmail.com,tethera.net]; RCVD_IN_DNSWL_FAIL(0.00)[50.126.95.6:server fail]; MIME_TRACE(0.00)[0:+]; RCVD_TLS_LAST(0.00)[]; ASN(0.00)[asn:27017, ipnet:50.126.64.0/18, country:US]; MID_RHS_MATCH_FROM(0.00)[]; FROM_NEQ_ENVFROM(0.00)[jrollins@caltech.edu,notmuch-bounces@notmuchmail.org]; RECEIVED_SPAMHAUS_PBL(0.00)[76.91.54.61:received]; URIBL_BLOCKED(0.00)[notmuchmail.org:email]; FROM_HAS_DN(0.00)[]; RCPT_COUNT_THREE(0.00)[4]; TAGGED_RCPT(0.00)[]; MIME_GOOD(-0.10)[text/plain]; PREVIOUSLY_DELIVERED(0.00)[notmuch@notmuchmail.org]; HAS_LIST_UNSUB(-0.01)[]; DMARC_NA(0.00)[caltech.edu]; RCVD_COUNT_SEVEN(0.00)[8]; SUSPICIOUS_RECIPS(1.50)[] X-TUID: e4OkIaxiRI4j On Wed, Apr 29 2020, Ciprian Dorin Craciun wrote: > I think there are two complete different use-cases for the `notmuch` binary: > * a simple CLI to query the database, in which case the current flags seem OK; > * a "poor-mans" API to query the database, more bellow; > > (I know there already exists an `libnotmuch` API accessible in many > programming languages. However for prototyping, and even for safety > and robustness, when performance isn't an issue, I find the tool-based > approach much more resilient.) > > Now about the "API" use-case, I assume that at the moment many users > have already integrated `notmuch` as it is with the current flags and > behaviour. Thus I agree that changing any flags in backward > incompatible way would make a lot of people unhappy, and will generate > perhaps quite a bit of "customer support". :) This is a good point. The CLI might be "poor", but important apps like notmuch-emacs are using them, so we should be careful about changing the interface. > Regarding the `--boolean` vs `--no-boolean` it does solve the > strictness problem, however it makes the life of script developers > quite hard, as now he has a `case` or `if/then/else`. Therefore I > would say that `--flag=value` is the best option as it can be simply > written as `--flag={FLAG:-true}` or in Python for example `"--flag=%s" > % _flag`. Also a good point. I guess the --flag=value interface is a safer/easier one to converge on. > Thinking even further uppon this, perhaps an even simpler idea would > be to provide a new command, like for example `notmuch api` that takes > on `stdin` a JSON with a specific format and does its job. This actually sounds like a pretty good idea... jamie.