[Toybox] re using get_optflags()

Rob Landley rob at landley.net
Fri Jun 22 06:59:03 PDT 2012


On 06/21/2012 09:28 AM, David Seikel wrote:
> What are the chances that get_optflags() could be made re usable by
> toys?

Well, right now you can put a NULL as your optstring and then set
which->options yourself and call get_optflags().

> For toys that need to make their own little scripting system for
> example.  Currently it seems to want to use the toys global, and I'm
> not sure if it's safe to screw with that after pulling all of my toys
> options out of it.
> 
> Would it get reused like that for shell internal commands?

Already does. In toys/toysh.c function run_pipeline() look for the
TOYFLAG_NOFORK bit.

This probably needs to be genericized somewhere in lib, but I never got
around to it.

> Would be nice to just reuse all that code instead of writing something
> similar for internal scripts and such.

Do you need something more than "a less-incomplete toysh" here? (I don't
understand your use case...)

Rob
-- 
GNU/Linux isn't: Linux=GPLv2, GNU=GPLv3+, they can't share code.
Either it's "mere aggregation", or a license violation.  Pick one.

 1340373543.0


More information about the Toybox mailing list