apr-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Karl Fogel <kfo...@galois.collab.net>
Subject Re: RFC on interface change to apr_getopt_long()
Date Mon, 20 Nov 2000 19:40:05 GMT
Greg Hudson <ghudson@MIT.EDU> writes:
> There's no redundancy here (short options aren't currently specified
> in the long options array), but I suppose we could easily shoehorn
> short options into the long options structure by assuming that any
> option with a single-character name is a short option.
> 
> (Just to be clear, short options and long options are specified
> differently on the command line.  "-abc" is three short options,
> unless -a or -b takes an argument; "--abc" is one long option.)

Yes, that's clear (about one dash vs two dashes).

Okay.  Anyway, I think it would be nice if, when a short and long
option mean the same thing, they could be specified in the same
place. :-)

One way is to replace the `val' field in apr_getopt_long_t with this:

   /* An array of single-letter options, any of which is equivalent to
      this long option, terminated by '\0'. */
   const char *short_equivs;

Of course, there would be no need for colons in that array, since the
`has_arg' field is already there.

How does that sound?

> Nope.  (I designed the interface, and paid no attention to the planned
> implementation.)

Cool, I take that back. :-)

-K

Mime
View raw message