At Thu, 16 Jul 2015 22:39:32 -0500, "Matthew D. Fuller" 
<[email protected]> wrote:
Subject: Command line args
> 
> 
> So while I'm running around with a machete breaking things, I'd like
> to do the same with our command-line args and parsing.  Short version:
> I'm gonna rewrite it to use getopt_long(), assume the system provides
> it, and we'll deal with hacking around systems that don't if and when
> we run across them.  That means our -long args will turn into --long
> args.  That cool with everybody?

Well, that'll be a bit annoying, but not the worst thing I've had to
deal with in my .xinitrc I guess.

When such a change totally breaks scripts using the command line anyway
then I would prefer going back to single-letter options and throwing
long-name options as far as the eye can see, or further, and into
/dev/null forever.  GNU Options suck, IMNSHO.  RTFM.  :-)  There, I've
declared that I'm an anachronism and a curmudgeon.

My ctwm command line is, in its most common usage, seen in this variable
setting:

        WM="ctwm -k -display $DISPLAY -W"

Now I'll need to parametrise it as I'll never manage to get all systems
I use upgraded at the same time.  I can do it, but I am complaining!


> getopt(3) can be pretty well assumed to be everywhere, since A&T and
> Berkeley picked it up in the early-mid 80's.

Indeed.  (and it's been in POSIX forever)

>  But it doesn't do long args,

And that's a very good thing!  :-)

POSIX is good enough, or at least it should be, and there's no
getopt_long(3) in POSIX, at least not as of the 2013 edition.

-- 
                                                Greg A. Woods
                                                Planix, Inc.

<[email protected]>       +1 250 762-7675        http://www.planix.com/

Attachment: pgpbRs9yV10ch.pgp
Description: PGP signature

Reply via email to