Question for Vodz about getopt_ulflags ([PATCH] inside)

Rob Landley rob at landley.net
Thu May 4 16:23:26 UTC 2006


On Thursday 04 May 2006 2:03 am, Tito wrote:
> > How does that work?  When I try to feed it an option it doesn't
> > recognize, I expect:
> > ./busybox ps -z
> > ps: invalid option -- z
> >
> > Plus a dump of the help text...
>
> static const char hdparm_options1[]=	"All options,but you use and test just
> < max"
>
> static const char hdparm_options2[]=	"options > max";

Ah, clever.

Yes, that would work.  (Assuming getopt's tendency to reorder the command line 
doesn't screw things up with multiple parsing passes. :)

You can even use hdparm_options1+26 (or so) instead of having a second 
hdparm...

Rob
-- 
Never bet against the cheap plastic solution.



More information about the busybox mailing list