[vox-tech] writing free getopt, ran into a dilemma...
Mark K. Kim
vox-tech@lists.lugod.org
Thu, 28 Mar 2002 09:13:19 -0800 (PST)
The one I tried to link statically on Windows one time said it was GPL,
but according to Micah it's apparently LGPL with misdocumentation. :P
The reason I'm writing my own getopt is because I want static linkage.
Anyway, some options I'm thinking about:
1. Get rid of optind altogether.
2. Shuffle argv[] like LGPL getopt.
3. Set optind to the beginning of the last set of non-option arguments.
4. Set optind to the beginning of the first non-option argument.
I really don't want to shuffle argv[] (option #2) because I can see how a
non-shuffling getopt could be useful on systems that won't let you shuffle
argv[]. Options #3 and #4 are direct opposites of each other, and each
can be beneficial at different times. While #3 seems to make more sense
to me, it's nothing you can't handle by using the "-" option in "optstr".
And while #4 seems to make little sense, it can be useful if you're trying
to determine if there are any non-option arguments and throw an error,
which you can't do any other way that I can think of.
-Mark
On Thu, 28 Mar 2002, nbs wrote:
> On Thu, Mar 28, 2002 at 12:35:05AM -0800, Mark K. Kim wrote:
> > Keywords: getopt, license issues, GPL, BSD, optind
> >
> > Hey guys,
> >
> > I mentioned some months ago about how I was using GPL's "getopt" library
> > in one of my company programs, and I was wondering about the GPL
> > distribution issues.[1]
>
> Woah... getopt library is GPL, not LGPL?
>
> -bill!
> _______________________________________________
> vox-tech mailing list
> vox-tech@lists.lugod.org
> http://lists.lugod.org/mailman/listinfo/vox-tech
>
--
Mark K. Kim
http://www.cbreak.org/
PGP key available upon request.