code: func Generate() (files []string, err error) {
  	var (
  		outDir, toolDir, target, ver string
  		notest, notool, regen        bool
  	)
  
  	set := flag.NewFlagSet("app", flag.PanicOnError)
  	set.String("design", "", "")
  	set.StringVar(&outDir, "out", "", "")
  	set.StringVar(&target, "pkg", "app", "")
  	set.StringVar(&ver, "version", "", "")
  	set.StringVar(&toolDir, "tooldir", "tool", "")
  	set.BoolVar(&notest, "notest", false, "")
  	set.BoolVar(&notool, "notool", false, "")
  	set.BoolVar(&regen, "regen", false, "")
  	set.Bool("force", false, "")
  	set.Parse(os.Args[1:])
  	outDir = filepath.Join(outDir, target)
  
  	if err := codegen.CheckVersion(ver); err != nil {
  		return nil, err
  	}
  
  	target = codegen.Goify(target, false)
  	g := &Generator{OutDir: outDir, Target: target, NoTest: notest, API: design.Design, validator: codegen.NewValidator()}
  
  	return g.Generate()
  }
docs: // Generate is the generator entry point called by the meta generator.