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 27766 invoked from network); 31 Jul 2021 22:15:00 -0000 Received: from minnie.tuhs.org (45.79.103.53) by inbox.vuxu.org with ESMTPUTF8; 31 Jul 2021 22:15:00 -0000 Received: by minnie.tuhs.org (Postfix, from userid 112) id 12E319CA48; Sun, 1 Aug 2021 08:14:59 +1000 (AEST) Received: from minnie.tuhs.org (localhost [127.0.0.1]) by minnie.tuhs.org (Postfix) with ESMTP id 5E9759C9B4; Sun, 1 Aug 2021 08:14:47 +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="MOzZm9HH"; dkim-atps=neutral Received: by minnie.tuhs.org (Postfix, from userid 112) id 71D229C9B4; Sun, 1 Aug 2021 08:14:45 +1000 (AEST) Received: from mail-qv1-f46.google.com (mail-qv1-f46.google.com [209.85.219.46]) by minnie.tuhs.org (Postfix) with ESMTPS id E5D7C9C9B2 for ; Sun, 1 Aug 2021 08:14:44 +1000 (AEST) Received: by mail-qv1-f46.google.com with SMTP id x12so7119928qvo.12 for ; Sat, 31 Jul 2021 15:14:44 -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=9QWH8k6rVc1L2Q0qIAzlkHeIuV/9ZRlcm1KRKYpcHAc=; b=MOzZm9HHoTYx4TwPNSQCN/Q7Fs7vcFwUJJBBVnIc0lhXNaNXTwbKDpkSQRZ4nQcu97 sjS7YGfPaxVf72QpYyB1zr3Z2vd++dqWwdee5dbKm2T3WA6HihulXTb/kAv3b/grKKpB xEe9qlxmQ0cYxhalhZHfWMBOkaAOKqc3obaPySl4WpGBDQNIIWOYCJxJNMMXU7K9PhrN RCdWfxty/SKOjKx4Ihem7BuPuMGSQTCz2s/dEbl+y1q9J+jC1NZr2+Kn/bpr9DKeY8Wp EI9g1FWBPyZ+nyWUmLDWJvWJ/aTVXW6fytIjGEQSp/eVWwhFMQE/0zxwp4X4qwhNphRq ow3A== 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=9QWH8k6rVc1L2Q0qIAzlkHeIuV/9ZRlcm1KRKYpcHAc=; b=IH21jQpJVhwMrmdzVm6UHbeoPVcgQK6SQai+P+6H6uoIVWl571M97j6rBYtQwNKV+2 q4m1WxIml+TUNKrszTvmlAdWsdx3lB14WXwnIrEtMUuL7YZp+Ontgs8lbaXoQ1FdfV4k O75IhivVwZJH0ODd9GuVNH1w63m6KSGxyuRkQ2gXgPrEFSML8UceEHUf33+3Q+OPt3h0 W/Pw3ThgKLNhsYDB/FEmCIzQf8RkEalahbQ3O3QUPwye4wTSLgqn1ujaEAGTX2AmjQRx IRo2l9DFJGnbXk97DLvW8TXunBeTQPV/hf0jNPQ3zi/XPmxXDOR6ZH2EqBkBhJ5YRtGv Nrsg== X-Gm-Message-State: AOAM5327RTc+rL8RxiQKSnC7c/IeLXkwg7kNiJ9TpQZZWMbwXKUV0YoE u2khcFRROKkl/z+Tnh/f14lW1RuumzTsvuLB X-Google-Smtp-Source: ABdhPJxMGLhNWjHANpoOUIIERFOz2J86yEcsfjWVjc9ZFvDtqPQnP9l2QlsCCtMKyftJ3Dlq2mSBPQ== X-Received: by 2002:a0c:fd61:: with SMTP id k1mr9442668qvs.49.1627769683991; Sat, 31 Jul 2021 15:14:43 -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 x14sm2512730qts.13.2021.07.31.15.14.43 (version=TLS1_2 cipher=ECDHE-ECDSA-AES128-GCM-SHA256 bits=128/128); Sat, 31 Jul 2021 15:14:43 -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: <20210731221317.GG23759@mcvoy.com> Date: Sat, 31 Jul 2021 15:14:41 -0700 Content-Transfer-Encoding: quoted-printable Message-Id: 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: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 That is easy to fix: use full options in scripts. Abbreviations for interactive use. Much better than --always-having-to-type-long-names. >=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.