Exemple #1
0
func listStandard() error {
	app, err := typewriter.NewApp("+gen")

	if err != nil {
		return err
	}

	fmt.Fprintln(out, "Installed typewriters:")
	for _, tw := range app.TypeWriters {
		fmt.Fprintf(out, "  %s\n", tw.Name())
	}

	return nil
}
Exemple #2
0
Fichier : run.go Projet : ngaut/gen
func runStandard() error {
	app, err := typewriter.NewApp("+gen")

	if err != nil {
		return err
	}

	if len(app.Types) == 0 {
		return fmt.Errorf("No types marked with +gen were found. See http://clipperhouse.github.io/gen to get started, or type %s help.", os.Args[0])
	}

	if len(app.TypeWriters) == 0 {
		return fmt.Errorf("No typewriters were imported. See http://clipperhouse.github.io/gen to get started, or type %s help.", os.Args[0])
	}

	if err := app.WriteAll(); err != nil {
		return err
	}

	return nil
}