[entirely off topic]

Rob Landley rob at landley.net
Sun Nov 5 20:26:42 UTC 2006


On Sunday 05 November 2006 12:20 pm, Luciano Miguel Ferreira Rocha wrote:
>    find . -print0 | cpio -0oHnewc | gzip -9 > ../initrd.img

Now _that_ is an ugly set of command line options (for cpio).  Let's see, that 
should equate to:

	cpio -0 -o -H newc 

I'm interested in this because I'm about halfway through writing toybox's 
get_optflags(), which doesn't use getopt() so I have to parse all this 
myself.  It's not actually that hard, but the tricky case is where some of 
your arguments have no dash, ala ps or tar.  Then you can wind up with stuff 
like:

	tar xjfCv filename.tbz dirname blah

Which is equivalent to:

	tar -x -j -f filename.tbz -C dirname -v blah

And _not_ equivalent to:

	tar -x -j -f C -v filename.tbz blah

Which is what you get with the getopt() in uClibc 0.9.28.  (I realize this is 
a funky corner case, but it's one that bit me and I want to get it _right_ 
this time.)

It looks like the nodash mode and the dash mode of the option parser have 
different sequencing requirements.  Ok, I can do that...

Rob
-- 
"Perfection is reached, not when there is no longer anything to add, but
when there is no longer anything to take away." - Antoine de Saint-Exupery



More information about the busybox mailing list