From owner-freebsd-hackers Sat Aug 12 18:17:31 1995 Return-Path: hackers-owner Received: (from majordom@localhost) by freefall.FreeBSD.org (8.6.11/8.6.6) id SAA28761 for hackers-outgoing; Sat, 12 Aug 1995 18:17:31 -0700 Received: from UUCP-GW.CC.UH.EDU (UUCP-GW.CC.UH.EDU [129.7.1.11]) by freefall.FreeBSD.org (8.6.11/8.6.6) with SMTP id SAA28755 for ; Sat, 12 Aug 1995 18:17:27 -0700 Received: from Taronga.COM by UUCP-GW.CC.UH.EDU with UUCP id AA05881 (5.67a/IDA-1.5); Sat, 12 Aug 1995 19:47:56 -0500 Received: by bonkers.taronga.com (smail2.5p) id AA10528; 12 Aug 95 19:45:53 CDT (Sat) Received: (from peter@localhost) by bonkers.taronga.com (8.6.11/8.6.6) id TAA10525; Sat, 12 Aug 1995 19:45:52 -0500 Date: Sat, 12 Aug 1995 19:45:52 -0500 From: Peter da Silva Message-Id: <199508130045.TAA10525@bonkers.taronga.com> To: thomas@ghpc8.ihf.rwth-aachen.de Subject: Re: parsing the command line (was: Kernel configuration/compilation tool) Newsgroups: taronga.freebsd.hackers In-Reply-To: <199508020905.LAA17379@ghpc6.ihf.rwth-aachen.de> Organization: Taronga Park BBS Cc: hackers@freebsd.org Sender: hackers-owner@freebsd.org Precedence: bulk >Just a quick note: Brad Appleton's `libcommand' is really called >`libcmdline' (sorry, memory error), and I'll look into this >parseargs lib (from comp.sources.misc, by Eric Allman, mods by Peter >da Silva and Brad Appleton). On a first glance this looks very >similar to libcmdline, just in C and a bit older (latest file date >on the server where I found it is June '92). The history is basically this. Eric Allman published Parseargs, and I looked at it and said "wow, this is totally cool". It had some gross code (like using foo(fmt, a, b, c, d, e, f, g)... sprintf(s, foo, a, b, c, d, e, f, g) for varargs :-P ) but was really nice... for UNIX. I needed to support the same code on Amiga, MS-DOS, and UNIX. I added some stuff to Parseargs to handle multiple O/S command line arguments, and used it pretty heavily. I then posted it back as an update to Allman's work. Brad Appleton grabbed it and had the same reaction and did the VMS updates, then kinda went crazy with extensions until it was too complex for Allman's original structure. He then wrote his new interface. I kept on using parseargs. It's pretty cool. Makes a command line that conforms to POSIX pretty mindless. As it stands it's almost compatible with GNU interface, but uses "+" instead of "--" for keyword-args. I hadn't thought of it for a while, but I think it covers most of what you need...