cmd

package
v0.0.4 Latest Latest
Warning

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

Go to latest
Published: Jan 23, 2024 License: MIT Imports: 24 Imported by: 0

Documentation

Index

Constants

View Source
const Zfile = ".zzz.yaml"

Variables

View Source
var New = cli.Command{
	Name:        "new",
	Usage:       "create zzz file",
	Description: `create zzz configuration file`,
	Action:      CmdNew,
	Flags:       []cli.Flag{},
}
View Source
var Run = cli.Command{
	Name:        "run",
	Usage:       "Run the application",
	Description: `Run the application by starting a local development server`,
	Action:      CmdRun,
	Flags: []cli.Flag{
		stringFlag("ldflags, ld", "", "Set the build ldflags. See: https://golang.org/pkg/go/build/"),
	},
}
View Source
var Version = cli.Command{
	Name:        "version",
	Usage:       "show env info",
	Description: `show env info`,
	Action:      CmdVersion,
	Flags:       []cli.Flag{},
}

Functions

func CmdAutoBuild

func CmdAutoBuild(rootPath string)

func CmdDone

func CmdDone(rootPath string)

func CmdNew

func CmdNew(c *cli.Context) error

func CmdRestart

func CmdRestart(rootPath string)

func CmdRun

func CmdRun(c *cli.Context) error

func CmdRunAfter

func CmdRunAfter(rootPath string)

func CmdRunBefore

func CmdRunBefore(rootPath string)

func CmdRunExit added in v0.0.3

func CmdRunExit(rootPath string)

func CmdStart

func CmdStart(rootPath string)

func CmdVersion

func CmdVersion(c *cli.Context) error

func GetBashFileSuffix added in v0.0.4

func GetBashFileSuffix() string

func GetGoVersion

func GetGoVersion() string

func InitBanner

func InitBanner(out io.Writer, in io.Reader)

InitBanner loads the banner and prints it to output All errors are ignored, the application will not print the banner in case of error.

func Kill

func Kill()

Kill kills the running command process

func Now

func Now(layout string) string

Now returns the current local time in the specified layout

func ShowShortVersionBanner

func ShowShortVersionBanner()

ShowShortVersionBanner prints the short version banner.

Types

type RuntimeInfo

type RuntimeInfo struct {
	GoVersion  string
	GOOS       string
	GOARCH     string
	NumCPU     int
	GOPATH     string
	GOROOT     string
	Compiler   string
	ZZZVersion string
}

RuntimeInfo holds information about the current runtime.

type ZZZ

type ZZZ struct {
	Title     string
	Frequency int64
	DirFilter []string
	Ext       []string
	EnableRun bool
	Action    struct {
		Before []string `yaml:"before"`
		After  []string `yaml:"after"`
		Exit   []string `yaml:"exit"`
	}
	Link string
}

Note: struct fields must be public in order for unmarshal to correctly populate the data.

Jump to

Keyboard shortcuts

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