appinit

package
v0.8.1 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Aug 11, 2023 License: AGPL-3.0 Imports: 9 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var CmdInit = &cli.Command{
	Name:  "init",
	Usage: "init a sketch Wa module",
	Flags: []cli.Flag{
		&cli.StringFlag{
			Name:    "name",
			Aliases: []string{"n"},
			Usage:   "set app name",
			Value:   "hello",
		},
		&cli.StringFlag{
			Name:    "pkgpath",
			Aliases: []string{"p"},
			Usage:   "set pkgpath file",
			Value:   "myapp",
		},
		&cli.BoolFlag{
			Name:    "update",
			Aliases: []string{"u"},
			Usage:   "update example",
		},
	},

	Action: func(c *cli.Context) error {
		err := InitApp(c.String("name"), c.String("pkgpath"), c.Bool("update"))
		if err != nil {
			fmt.Println(err)
			os.Exit(1)
		}
		return nil
	},
}

Functions

func InitApp

func InitApp(name, pkgpath string, update bool) error

Types

This section is empty.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL