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=-1.1 required=5.0 tests=DKIM_SIGNED,DKIM_VALID, DKIM_VALID_AU,HTML_MESSAGE,MAILING_LIST_MULTI,RCVD_IN_DNSWL_NONE autolearn=ham autolearn_force=no version=3.4.4 Received: (qmail 23179 invoked from network); 31 Jul 2021 16:41:55 -0000 Received: from minnie.tuhs.org (45.79.103.53) by inbox.vuxu.org with ESMTPUTF8; 31 Jul 2021 16:41:55 -0000 Received: by minnie.tuhs.org (Postfix, from userid 112) id 5FF3A9C9E1; Sun, 1 Aug 2021 02:41:54 +1000 (AEST) Received: from minnie.tuhs.org (localhost [127.0.0.1]) by minnie.tuhs.org (Postfix) with ESMTP id A9C209C9B2; Sun, 1 Aug 2021 02:41:33 +1000 (AEST) Authentication-Results: minnie.tuhs.org; dkim=pass (1024-bit key; unprotected) header.d=ccc.com header.i=@ccc.com header.b="Xuq1wS8I"; dkim-atps=neutral Received: by minnie.tuhs.org (Postfix, from userid 112) id 8B9EB9C9B2; Sun, 1 Aug 2021 02:41:31 +1000 (AEST) Received: from mail-qt1-f169.google.com (mail-qt1-f169.google.com [209.85.160.169]) by minnie.tuhs.org (Postfix) with ESMTPS id 0D9019C9AF for ; Sun, 1 Aug 2021 02:41:31 +1000 (AEST) Received: by mail-qt1-f169.google.com with SMTP id k13so8731818qth.10 for ; Sat, 31 Jul 2021 09:41:31 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=ccc.com; s=google; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc; bh=K1/vpca0otgPFomuOPAXILFrhAZ8ZgU6kse1ZW6x0So=; b=Xuq1wS8IlaWAPYBBraT0xA+t1/LaTDdzBmXYZSXT8ZktsGHXQAo9bdCYHRDy/MI18U XA8W/qHbDFa9ncLDMBOHbH1YKzJqLJgaO6IWeQzrECoEGY69GIa/RlCj3O5Bkbqetvtb HnwN8JrsNkhg7WjDy5txsFjbLvlZhJ1e9c0c0= 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=K1/vpca0otgPFomuOPAXILFrhAZ8ZgU6kse1ZW6x0So=; b=Oq/C86ge8NaArDly+PC83AYz41y4lARBD7Rbwp6k9CHUpfqVM1UF3BWiu4jjXSjpED 9XIvTcWmJtAZ8WupcgTO2CyAPOG1IKoE4uZ33WYx4Qko55bu3VPJ00vW1O2j9juZbU/G uk0J+sZemzP71DfkBceB1B2wl38bdboz1QMf89t2Oj1R9bQmtMf0BFNJA1G/z6EClm8Z 17Lg7UJY2KaC2EceLTl+XrsrrGp9U2MCy92pnPIEcblt9i1Cr+OnCe5SKVD4mCMC2FT5 I16enD1zjhYsO4kowdEmWCNFveVESOeLRCjWMYqRxt4lai7wTR8kmMgZbN0KbHTcKTSY dtEQ== X-Gm-Message-State: AOAM532IyFCRZRKvx6dNSVdVEk/Ju7Y9Lo5NIdnaIH0GTP65UumM3q3D lXN/UfNawkv6BMV8ob69eUBQNA0qo4BcsE6uUC0JCAzAeaYJkBIH X-Google-Smtp-Source: ABdhPJw6r7cGT2nN3/JHk9e4NzTh6P6jd1luIG0CvEFs2BfI033XoLRhJ9gvLUBdjykPN1jfupUueJ9ZjlXpgOu5DJA= X-Received: by 2002:ac8:7f85:: with SMTP id z5mr7218360qtj.354.1627749689827; Sat, 31 Jul 2021 09:41:29 -0700 (PDT) MIME-Version: 1.0 References: <20210731142533.69caf929@moon> In-Reply-To: <20210731142533.69caf929@moon> From: Clem Cole Date: Sat, 31 Jul 2021 12:41:04 -0400 Message-ID: To: Michael Siegel Content-Type: multipart/alternative; boundary="0000000000000bb4aa05c86e024f" Subject: Re: [TUHS] Systematic approach to command-line interfaces 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" --0000000000000bb4aa05c86e024f Content-Type: text/plain; charset="UTF-8" On Sat, Jul 31, 2021 at 8:36 AM Michael Siegel wrote: > Hello, > > I've recently started to implement a set of helper functions and > procedures for parsing Unix-like command-line interfaces (i.e., POSIX + > GNU-style long options, in this case) As an old guy, I am amused to read these words .. because UNIX did not have a command-line parsing standard., and I remember the wars. If you came from a system, where the program was exec's with the command line parameters pre-parsed (like the DEC world, ITS, and some others); UNIX seemed foreign and often consider 'bad' by folks. The biggest argument (which was reasonable) was Unix command, sometimes used 'keys' (like tp/tar and the like) and others used switches (cp, ed). Folks new to UNIX often b*tched as it being 'inconsistent (read things like the 'UNIX Haters Book'). I admit I was 'surprised' when I came there in the Fifth Edition in the mid-70s from the PDP-10 world, but as a programmer, I ended up really liking the fact that the command-line was not pre-parsed, other than white space removal and I did not have figure out some strange syntax for findnext() and other UUO/JSYS from my previous life. So by the late 70's early 80's, a number of different UNIX parsing schemes popped up. Like the stuff from Columbia Richard pointed out. TCL in some ways end result, which had a life that was useful, but fell away too eventually. The whole getopt(3) thing appeared originally inside of BTL. The first version I was was from USB (Summit), but I'm not sure they were the original authors. One problem was that it was tied up with later AT&T licenses [i.e. PWB or later] and was not in Research, the USENIX community lacked it. Thus when AT&T brought it to us to consider for POSIX.2, there was balking. The ISV's seemed to like it, but there was not a lot of support elsewhere. At some point, somebody in the USENIX community wrote a version and posted it to comp.unix.sources and some people began to use it. Of course, GNU had to take it and pee on it, so we got the long file name stuff. All in all, it's what's you are used I suspect. The AT&T whole getopt(3) thing works (I can deal with keys too BTW). I guess I just don't get excited about it, these days. Clem --0000000000000bb4aa05c86e024f Content-Type: text/html; charset="UTF-8" Content-Transfer-Encoding: quoted-printable


On S= at, Jul 31, 2021 at 8:36 AM Michael Siegel <msi@malbolge.net> wrote:
Hello,

I've recently started to implement a set of helper functions and
procedures for parsing Unix-like command-line interfaces (i.e., POSIX +
GNU-style long options, in this case)
As an old guy, I am amused to read these words .. because = UNIX did not have a command-line parsing standard., and I remember the wars= .=C2=A0 If you=C2=A0came from a system, where the program was exec's wi= th the command line parameters pre-parsed (like the DEC world, ITS, and som= e others); UNIX seemed foreign=C2=A0and often consider 'bad' by fol= ks.=C2=A0 =C2=A0The biggest argument (which was reasonable) was Unix comman= d, sometimes used 'keys' (like tp/tar and the like) and others used= switches (cp, ed).=C2=A0 =C2=A0Folks new to UNIX often b*tched as it being= =C2=A0'inconsistent=C2=A0(read things like the=C2=A0'UNIX Haters Bo= ok').=C2=A0 I admit I was 'surprised' when I came there in the= =C2=A0Fifth Edition in=C2=A0the mid-70s from the PDP-10 world, but as a pro= grammer, I ended up really liking the fact that the command-line was not pr= e-parsed, other than white space removal and I did not have figure out some= strange syntax for findnext() and other UUO/JSYS=C2=A0from my previous lif= e.

So by the late 70's early 80's= , a number of different UNIX parsing schemes popped up.=C2=A0 =C2=A0Like th= e stuff from Columbia Richard pointed out.=C2=A0 =C2=A0TCL in some ways end= result, which had a life that was useful, but fell away too eventually.=C2= =A0 =C2=A0The whole getopt(3) thing appeared originally inside of BTL.=C2=A0 =C2=A0= The first version I was was from USB (Summit), but I'm not sure they we= re the original authors.=C2=A0 =C2=A0One problem was that it was tied up wi= th later AT&T licenses [i.e. PWB or later] and was not in Research, the= USENIX community lacked it.=C2=A0 Thus when AT&T brought it to us to c= onsider for POSIX.2, there was balking.=C2=A0 The ISV's=C2=A0seemed to = like it, but there was not a lot of support elsewhere.=C2=A0 At some point,= somebody in the USENIX community wrote a version and posted it to comp.uni= x.sources and some people began to use it.=C2=A0 Of course, GNU had to take= it and pee on it, so we got the long file name stuff.

All in all, it's what's you are used I suspect.

The AT&T=C2=A0whole=C2=A0getopt(3) thing works (I can deal wi= th keys too BTW).=C2=A0 I guess I just don't get excited about it, thes= e days.

Clem

--0000000000000bb4aa05c86e024f--