From mboxrd@z Thu Jan 1 00:00:00 1970 X-Spam-Checker-Version: SpamAssassin 3.4.4 (2020-01-24) on inbox.vuxu.org X-Spam-Level: X-Spam-Status: No, score=-0.8 required=5.0 tests=DKIM_INVALID,DKIM_SIGNED, MAILING_LIST_MULTI,RCVD_IN_DNSWL_NONE autolearn=ham autolearn_force=no version=3.4.4 Received: (qmail 28151 invoked from network); 31 Jul 2021 22:18:29 -0000 Received: from minnie.tuhs.org (45.79.103.53) by inbox.vuxu.org with ESMTPUTF8; 31 Jul 2021 22:18:29 -0000 Received: by minnie.tuhs.org (Postfix, from userid 112) id A677D9CA66; Sun, 1 Aug 2021 08:18:26 +1000 (AEST) Received: from minnie.tuhs.org (localhost [127.0.0.1]) by minnie.tuhs.org (Postfix) with ESMTP id 5B4729CA5B; Sun, 1 Aug 2021 08:17:22 +1000 (AEST) Authentication-Results: minnie.tuhs.org; dkim=fail reason="signature verification failed" (2048-bit key; unprotected) header.d=iitbombay-org.20150623.gappssmtp.com header.i=@iitbombay-org.20150623.gappssmtp.com header.b="gvVHIGy0"; dkim-atps=neutral Received: by minnie.tuhs.org (Postfix, from userid 112) id 05B319C9DA; Sun, 1 Aug 2021 08:17:18 +1000 (AEST) Received: from mail-ot1-f43.google.com (mail-ot1-f43.google.com [209.85.210.43]) by minnie.tuhs.org (Postfix) with ESMTPS id DFC429C9EB for ; Sun, 1 Aug 2021 08:17:15 +1000 (AEST) Received: by mail-ot1-f43.google.com with SMTP id z6-20020a9d24860000b02904d14e47202cso4903590ota.4 for ; Sat, 31 Jul 2021 15:17:15 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=iitbombay-org.20150623.gappssmtp.com; s=20150623; h=mime-version:subject:from:in-reply-to:date:cc :content-transfer-encoding:message-id:references:to; bh=6ZEt0qOrKhMplbWf6ILzlqrce+tgjElp4gV0z2UbeAM=; b=gvVHIGy0Y5FaaM1hAKMX7hmjENjEDf96uZUeCnKr4EtMTt6dAZdUq3Gi7rp5EuL8TA o9zsInse5F60au2mk/mZPR7Ymc9qqsUtrelIQUjybTNNve/PWe4oV8rJ7nx1Fn5nIG8F vAmeg3lUJL6AAz0xQzapCq6wWnzLhjmW/ejU74xONqK+Y32J3C0k7QK1YmV07BJ0iMGF 8hMsmlk/Nas1jnaoSz50oNezZ7VnrGPzvJO85MkDqI4Q+YTNMNCRlBk2FoHfOoC9S4YY oERKvk2IJKd0XGW64+k/YkxAnUf4D59384grzfKYJnoXmy5SwPdQK4TUwAQOjWXvuhza CCIg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:subject:from:in-reply-to:date:cc :content-transfer-encoding:message-id:references:to; bh=6ZEt0qOrKhMplbWf6ILzlqrce+tgjElp4gV0z2UbeAM=; b=UR/lxHL+vOHqtdpOJNHwuPerG/RC17rUnoMGSe+YcmsZYrzZaIYQBKt9ykAnla2JxM 8qpF13XbhyaLqdFK6KS4vHtUt00yLrGdHDIlHlnZJd/iTWH5Mk1nNvBH3xnR6ypwdwrE RdUo1b8iQclGTX+O6xzY7MgycRs7JWQEVvu/UTyru6U+AO/Cld41Kb3Ou4T1P1Pql7kY T4q8t0p3LvTbIscOM+vVxxelV6fnHb9yXWVNBHX9mYp1OOPtXpaMz5xVx0qkWekKm3o/ 6EI4ympeodx3k0RaS86/qP123f21bYEp0MGzP8SHwjpRJN7PkXBSrl7Yu+eVr6XW60yX exzA== X-Gm-Message-State: AOAM533dceJhZ4R83TWJZ7kI94ob1w9o77CNUXapt/rkEA2Mhs97plcD 69PPmu+xRQzJeF1/45ZHPUjegLIOFwODhpfz X-Google-Smtp-Source: ABdhPJwh+vCl7hLGJhhZxiMTTBkHJtnjsaW4quLyhkiDmfe/uh+94vstk8cimVJm0qmjIbWlEwyolQ== X-Received: by 2002:a05:6830:2317:: with SMTP id u23mr6738002ote.88.1627769835224; Sat, 31 Jul 2021 15:17:15 -0700 (PDT) Received: from smtpclient.apple (107-215-223-229.lightspeed.sntcca.sbcglobal.net. [107.215.223.229]) by smtp.gmail.com with ESMTPSA id f3sm1105577otc.49.2021.07.31.15.17.14 (version=TLS1_2 cipher=ECDHE-ECDSA-AES128-GCM-SHA256 bits=128/128); Sat, 31 Jul 2021 15:17:14 -0700 (PDT) Content-Type: text/plain; charset=us-ascii Mime-Version: 1.0 (Mac OS X Mail 14.0 \(3654.120.0.1.13\)) From: Bakul Shah In-Reply-To: Date: Sat, 31 Jul 2021 15:17:13 -0700 Content-Transfer-Encoding: quoted-printable Message-Id: <68F654B3-7192-4E95-B09E-3B421A11E328@iitbombay.org> References: <20210731142533.69caf929@moon> <202107311920.16VJK2jT2362871@fourwinds.com> <3598EE71-E652-43EF-B1AB-91CB8B3D577A@iitbombay.org> <20210731221317.GG23759@mcvoy.com> To: Larry McVoy X-Mailer: Apple Mail (2.3654.120.0.1.13) Subject: Re: [TUHS] Systematic approach to command-line interfaces [ meta issues ] X-BeenThere: tuhs@minnie.tuhs.org X-Mailman-Version: 2.1.26 Precedence: list List-Id: The Unix Heritage Society mailing list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: TUHS main list Errors-To: tuhs-bounces@minnie.tuhs.org Sender: "TUHS" On Jul 31, 2021, at 3:14 PM, Bakul Shah wrote: >=20 > On Jul 31, 2021, at 3:13 PM, Larry McVoy wrote: >>=20 >> On Sat, Jul 31, 2021 at 03:04:48PM -0700, Bakul Shah wrote: >>> On Jul 31, 2021, at 12:20 PM, Jon Steinhart = wrote: >>>>=20 >>>> So I never got getopt(). One of my rules is that I don't use a = library >>>> in cases where the number of lines of gunk that that it takes to = use a >>>> library function is >=3D the number of lines to just write it = myself. Yeah, >>>> I know the "but the library has more eyeballs and is debugged" = argument >>>> but in reality libraries are the source of many bugs. I've always = taken >>>> the approach that I would never hire someone who had to use a = library to >>>> implement a singly-linked list. >>>=20 >>> getopt() is perhaps the wrong solution but consider something like = MH, >>> whose commands all follow a common pattern. Consider: >>>=20 >>> - options (switches) all start with a single '-' >>> - they may be abbreviated to a unique prefix. >>=20 >> That last one is a gotcha waiting to happen: >>=20 >> program --this-is-the-long-option >>=20 >> is the same as=20 >>=20 >> program --this >>=20 >> but that will break scripts (and fingers) when program gets a new=20 >> option like >=20 > That is easy to fix: use full options in scripts. Abbreviations for > interactive use. Much better than --always-having-to-type-long-names. >=20 >>=20 >> program --this-is-the-even-longer-option >>=20 >> We wrote our own getopt() for BitKeeper and it had long and short = options >> but no gotcha unique prefix. Forgot to add that whoever extends "program" should know not to create a = new option that uses a longer name breaking a full form old options.=