svn 15195
Rob Landley
rob at landley.net
Thu Jun 1 02:39:57 UTC 2006
On Wednesday 31 May 2006 5:22 pm, Rich Felker wrote:
> On Wed, May 31, 2006 at 05:14:56PM -0400, Rob Landley wrote:
> > 3) I think a better thing to do would be to figure out how to move the
> > long options to usage.h. (Since we have to document the applet's
> > arguments there anyway, we might as well _define_ them.) Remember how we
> > were talking about a rewrite of bb_getopt_ulflags to not use getopt()? I
> > have a vague plan for having long options look something like:
> >
> > char **sed_longopts = {
> > "x" "fruitbasket",
> > "y" "walrus",
> > "z" "turquoise",
> > ""
> > };
>
> char ** and char *[] waste (a lot of!) space and make readonly data
> into data if you use pic/pie. Using a single string with a separator
> character is better. \0 makes a good separator.
That's reasonable. The syntax doesn't even change much:
char *sed_longpots = \
"xfruitbasket\0" \
"ywalrus\0" \
"zturquoise"
(Still unsure if the two string segments or the one string segment is easier
to read. Either way, it's the same string...)
The thing is, this is blocked on a rewrite of getopt_ulflags(), which isn't
hard I just haven't got _time_...
> Rich
Rob
--
Never bet against the cheap plastic solution.
More information about the busybox
mailing list