适用于go lang的简单而实用的cli工具

163 阅读1分钟

(Kommando Go Report Card

简单而实用的go lang的cli工具。

安装

go get github.com/yigit433/kommando

例子

package main

import (
    "fmt"
    "github.com/yigit433/kommando"
    "github.com/yigit433/kommando/types"
)

func main() {
    app := kommando.NewKommando(types.Config{
        AppName: "Kommando Test App",
    })

    app.AddCommand(
        &types.Command{
            Name: "test",
            Description: "Hello world test example!",
            Execute: func(res *types.CmdResponse) {
                fmt.Println("Hello world!")
            },
        },
    )

    app.Run()
}