gocmds

package module
v0.0.8 Latest Latest
Warning

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

Go to latest
Published: Apr 29, 2019 License: MIT Imports: 8 Imported by: 1

README

gocmds

cmd for go

Documentation

Index

Constants

View Source
const (
	HomeFlag  = "home"
	TraceFlag = "trace"
	LogFlag   = "log_level"
)

Variables

View Source
var Env = struct {
	Dev  string
	Stag string
	Prod string
}{
	Dev:  "dev",
	Stag: "stag",
	Prod: "prod",
}

Functions

This section is empty.

Types

type Executor

type Executor struct {
	*cobra.Command
	Exit func(int) // this is os.Exit by default, override in tests
}

Executor wraps the cobra Command with a nicer Execute method

func PrepareBaseCmd

func PrepareBaseCmd(cmd *cobra.Command, envPrefix, defaultHome string) Executor

func (Executor) Execute

func (e Executor) Execute() error

execute adds all child commands to the root command sets flags appropriately. This is called by main.main(). It only needs to happen once to the rootCmd.

type ExitCoder

type ExitCoder interface {
	ExitCode() int
}

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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