Documentation ¶
Overview ¶
Package zcli quickly build cli applications
Index ¶
- Variables
- func Add(name, description string, command Cmd) *cmdCont
- func CheckErr(err error, exit ...bool)
- func Current() (interface{}, bool)
- func Error(format string, v ...interface{})
- func GetLangText(key string, def ...string) string
- func Help()
- func Input(problem string, required bool) (text string)
- func Inputln(problem string, required bool) (text string)
- func IsDoubleClickStartUp() bool
- func LaunchService(name string, description string, fn func(), config ...*daemon.Config) (daemon.ServiceIface, error)
- func LaunchServiceRun(name string, description string, fn func(), config ...*daemon.Config) error
- func Parse(arg ...[]string) (hasflag bool)
- func Run(runFunc ...runFunc) (ok bool)
- func SetLangText(lang, key, value string)
- func SetUnknownCommand(fn func(_ string))
- func SetVar(name, usage string) *v
- func SingleKillSignal() <-chan bool
- func Start(runFunc ...runFunc)
- type Cmd
- type Subcommand
Constants ¶
This section is empty.
Variables ¶
View Source
var ( // BuildTime Build Time BuildTime = "" // BuildGoVersion Build Go Version BuildGoVersion = "" // BuildGitCommitID Build Git CommitID BuildGitCommitID = "" // Log cli logger Log *zlog.Logger // FirstParameter First Parameter FirstParameter = os.Args[0] Logo string Name string Version string HideHelp bool EnableDetach bool HidePrompt bool Lang = defaultLang ShortValues = map[string]interface{}{} )
Functions ¶
func GetLangText ¶ added in v0.1.54
func IsDoubleClickStartUp ¶ added in v0.1.30
func IsDoubleClickStartUp() bool
func LaunchService ¶ added in v0.1.31
func LaunchService(name string, description string, fn func(), config ...*daemon.Config) (daemon.ServiceIface, error)
LaunchService Launch Service
func LaunchServiceRun ¶ added in v0.1.31
LaunchServiceRun Launch Service and run
func SetLangText ¶ added in v0.1.54
func SetLangText(lang, key, value string)
func SetUnknownCommand ¶
func SetUnknownCommand(fn func(_ string))
SetUnknownCommand set unknown command handle
func SingleKillSignal ¶ added in v1.6.0
func SingleKillSignal() <-chan bool
Types ¶
type Cmd ¶
type Cmd interface { Flags(subcommand *Subcommand) Run(args []string) }
Cmd represents a subCommand
Click to show internal directories.
Click to hide internal directories.