Question for Vodz about getopt_ulflags ([PATCH] inside)

Tito farmatito at tiscali.it
Thu May 4 20:27:04 UTC 2006


On Thursday 4 May 2006 18:23, Rob Landley wrote:
> 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...

False alarm, this doesn't work. Vodz is right. I'm testing with his first patch 
and it works fine if you do it like this:

static const char hdparm_options1[]=	"All options A-Z ,but  use and test just until max num"
static const char hdparm_options2[]=	"All options Z-A ,but  use and test just until max num";

I haven't had time to test Vodz's second patch about this issue so far as I'm busy in trying to
solve to option parsing for hdparm....

Ciao,
Tito 
> 
> Rob



More information about the busybox mailing list