Categorygithub.com/lib4dev/cli
modulepackage
1.2.8
Repository: https://github.com/lib4dev/cli.git
Documentation: pkg.go.dev

# README

cli

命令行程序基础框架

一、创建cli app

func main(){
    var app=cli.New(cli.WithVersion("0.1.0"))
    app.Start()
}


二、添加处理命令


//Action .
func list(c *cli.Context) (err error) {
	//do something...
	return nil
}

func init() {
	cmds.Register(
		cli.Command{
			Name:   "ls",
			Usage:  "列出所有子节点",
			Action: list,
		})
}

# Packages

No description provided by the author
No description provided by the author

# Functions

New 创建app.
WithUsage 设置使用说明.
WithVersion 设置版本号.

# Variables

VERSION 版本号.

# Structs

App cli app.

# Type aliases

Option 配置选项.