func (e *qEnv) run() { e.Lock() app.NewEnv(e.vars) app.NewNS(nil) e.Unlock() for fn := range e.runc { if fn != nil { fn() } } }
// runs here func runNew(x *xEnv, argv ...string) error { opts := opt.New("dup") app.Dprintf("dup %v\n", argv) args, err := opts.Parse(argv) if err != nil { opts.Usage() return dbg.ErrUsage } for _, arg := range args { switch arg { case "ns": app.NewNS(nil) case "io": app.NewIO(nil) case "env": app.NewEnv(nil) case "dot": app.NewDot("") default: app.Warn("unknown resource '%s'", arg) } } return nil }