From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from localhost (localhost [127.0.0.1]) by arlo.cworth.org (Postfix) with ESMTP id 27AF56DE0B78 for ; Mon, 25 Sep 2017 06:28:00 -0700 (PDT) X-Virus-Scanned: Debian amavisd-new at cworth.org X-Spam-Flag: NO X-Spam-Score: -0.038 X-Spam-Level: X-Spam-Status: No, score=-0.038 tagged_above=-999 required=5 tests=[AWL=-0.038] autolearn=disabled 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 DoWygVoqPZ7N for ; Mon, 25 Sep 2017 06:27:59 -0700 (PDT) Received: from che.mayfirst.org (che.mayfirst.org [162.247.75.118]) by arlo.cworth.org (Postfix) with ESMTP id 5A7366DE0A6C for ; Mon, 25 Sep 2017 06:27:59 -0700 (PDT) Received: from fifthhorseman.net (ool-6c3a0662.static.optonline.net [108.58.6.98]) by che.mayfirst.org (Postfix) with ESMTPSA id 8E5EFF99A; Mon, 25 Sep 2017 09:27:55 -0400 (EDT) Received: by fifthhorseman.net (Postfix, from userid 1000) id 4F9F828382; Mon, 25 Sep 2017 09:02:05 -0400 (EDT) From: Daniel Kahn Gillmor To: David Bremner , Jani Nikula Cc: Notmuch Mail Subject: Re: [PATCH 0/9] argument parsing fixes and improvements In-Reply-To: <87bmlz57wq.fsf@tethera.net> References: <87mv5qxt3d.fsf@fifthhorseman.net> <87o9q5wlnj.fsf@fifthhorseman.net> <87k20st1yl.fsf@nikula.org> <87bmlz57wq.fsf@tethera.net> Date: Mon, 25 Sep 2017 09:02:02 -0400 Message-ID: <8760c7x779.fsf@fifthhorseman.net> MIME-Version: 1.0 Content-Type: multipart/signed; boundary="=-=-="; micalg=pgp-sha512; protocol="application/pgp-signature" X-BeenThere: notmuch@notmuchmail.org X-Mailman-Version: 2.1.23 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: Mon, 25 Sep 2017 13:28:00 -0000 --=-=-= Content-Type: text/plain Content-Transfer-Encoding: quoted-printable On Mon 2017-09-25 08:34:13 -0300, David Bremner wrote: > I think there is two different discussions one could be having here; one > about the UI, the other about the implimentation. > > From the UI point of view, Are you using the term "UI" to mean "API" here? i tend to think of "UI" as the CLI interface, which i think still has open questions (see below). > it seems like the best thing is to use any > configuration to set the default for a given boolean flag. Conceptually > this would look something like (semi-pseudo-code) > > try_decrypt =3D false; >=20=20=20=20=20 > notmuch_database_get_config(notmuch, "try_decrypt", &try_decrypt); > > parse_arguments(argc, argv, ...) > > We have 3 possibilities, with the latest specified one winning. > > In the implmentation, we need to cope with the fact that the database > probably can't be opened until after the command line arguments are > processed. in my cleartext-index series, reading the config from the database doesn't happen until it's needed, because it is deferred to the creation of the indexopts object (which you can't get without a database). So from an implementation point of view, it's definitely cleaner/simpler to have an internally "explicitly unset" state for the CLI flags. From=20a CLI UI perspective: do we want to be able to send --foo=3Ddefault for a boolean explicitly? --dkg --=-=-= Content-Type: application/pgp-signature; name="signature.asc" -----BEGIN PGP SIGNATURE----- iQIzBAEBCgAdFiEEOCdgUepHf6PklTkyFJitxsGSMjcFAlnI/koACgkQFJitxsGS Mjeikw//ZJp3Z42LMqgcxE/EAoMiMSgAkh7VtpYvB7IMJhGFBBPpvSSe48Gs9CP2 HBH8M0iaqMO8CLh0kWUYDs153RmNcGNHmtEBmUyqksXFx/Yr7xKSjSxj6Bdhdq90 ePtMYTTao215cpNOkqSzZ4/aURiQJ2wB4VnAjXtYcHjBhk69RCFiQ1zic7L39ir1 OnenGkeI4sYeAoVhq/NKOoGSddUe7uo3VjFsEOmhC3KqzE1TxISQrV3Wdqytqfbz m7uMid2AJakPOH9YI2sKc4HzXdSWip5FaG7HefEB2gBNC6lZOeQ0SPH6O32+bt5u WFIZOTk3DW61LyUIteOvaMrGD3HXYKdCsTPGQbF1q+O3nLocY5WxJrwdnQJcLEBB Dg7Lzb6DSQVfmDbBatx9n1/v0uqs+JxyGo5xbyGqbEGwyT/U8s2jpNkQe7P9TbXV El2+oKl14p6MOkc4iv7Vq13fv047WzV/0X65JKZ0i3Ub3Yhf2qRnr20ALWzhKksD PGltfVXePmns2edN6F7+kFlXzjvNscfIXRBRJrJm+PPQBHl8cN1y+J18p1VAweso 2aDrYB+xUpBGZsOJTbrzen3NmYOvQ6U17lYOKrGC5MqY8rg3PrkMGrJasA0EJryF cYNxMrsYSbXth9Ez6FU18kbNfIY+wisHn4//rgyK5zRLVKzERZw= =TCil -----END PGP SIGNATURE----- --=-=-=--