[svn.haxx.se] · SVN Dev · SVN Users · SVN Org · TSVN Dev · TSVN Users · Subclipse Dev · Subclipse Users · this month's index

Re: Tabular command processing sans AutoOpts

From: Greg Hudson <ghudson_at_MIT.EDU>
Date: 2000-11-13 04:30:34 CET

Given what Karl has said (which I agree with), arguing at the detail
level is probably pointless. There is a point beyond which further
abstraction adds more cost than it removes, and I think most
Subversion developers currently believe the getopt_long interface is
as far as option-parsing should be abstracted. I will make a couple
of corrections for the sake of future edification:

> 2. You cannot enhance the struct without invalidating old code

If you mean "without invalidating old source code," then you can; add
elements to the end of the structure. They will get the value 0 if an
initializer doesn't include them.

If you meant "without invalidating old object code," then you're
perfectly correct; in a shared library you'd have to version the
symbol somehow to enhance the structure. But that's true of most C
library interfaces, and interfaces which avoid this problem (such as
the Xlib interface) are cumbersome to use.

> You *are* talking about re-inventing everything. Why? There are
> several option parsers out there already. Is each one so deficient
> that a new one is needed? Why?

apr already has an apr_getopt. I'm just going to enhance it with long
option support. It will take an hour or two when I collect some round
tuits. It will then fit nicely into any apr-using program without any
added build system complexity.
Received on Sat Oct 21 14:36:14 2006

This is an archived mail posted to the Subversion Dev mailing list.

This site is subject to the Apache Privacy Policy and the Apache Public Forum Archive Policy.