[Toybox] sed -i

Rob Landley rob at landley.net
Tue Dec 11 17:15:45 PST 2018


On 12/11/18 5:34 PM, enh wrote:
> Ah, I didn't actually check the code --- I saw that the docs mentioned --color
> but they strongly imply that ; is *only* for long options. (Though what does
> that mean for -i versus --in-place? Maybe I should just try it and see what
> happens!)

I very vaguely recall that -iblah would need to _not_ have a space? (Because it
doesn't know whether the next argument attaches to the -i or not unless there's
no space so it can't _not_ attach. Just like --longopt=blah can just not have
the =blah, and -ix could not have the x.)

It's possible that's not what uptream is doing? When I added -i to busybox, sed
didn't have an optional suffix for -i yet. (I was using knoppix at the time, I
think? Don't remember which version.)

The fun part of the option parsing logic was getting "echo -nex" to print "-nex"
rather than parsing 2 and then baring. The _previous_ fun part was getting "tar
xvzCf dirname filename" to work properly. And yes, I cared about both. There's a
_reason_ it's not trying to use the libc optargs plumbing...

I take it you have a script using the extension?

Rob



More information about the Toybox mailing list