[Toybox] sed -i

enh enh at google.com
Tue Dec 11 15:34:19 PST 2018


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!)

On Tue, Dec 11, 2018, 15:24 Rob Landley <rob at landley.net wrote:

> On 12/11/18 4:09 PM, enh via Toybox wrote:
> > what's the right way to express an argument like sed's -iSUFFIX that
> takes an
> > _optional_ string argument? right now i'm struggling to think of a
> similar
> > option to copy & paste from...
>
> I'm not quite sure what you mean, but I implemented ; in lib/args to do
> optional
> argument values, and just fixed a cp.c bug where I wasn't handling the
> "not set"
> case properly?
>
> It's also used in --color for ls, a couple places in nsenter and unshare,
> skeleton.c demonstrates it...
>
> I _think_ it handles short arguments properly, but could easily have
> missed a
> case...
>
> Rob
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.landley.net/pipermail/toybox-landley.net/attachments/20181211/6788442a/attachment-0001.htm>


More information about the Toybox mailing list