OpenMix 出品:https://openmix.org
Mix XCLI
命令行交互开发框架
CLI Interactive Commander
Overview
一个命令行交互开发库,它可以让单个 CLI 程序可执行多个命令,同时它还包括命令行参数获取、全局 panic 捕获与处理、程序后台执行等命令行开发常用功能。
Github
https://github.com/mix-go/xcli
Installation
go get github.com/mix-go/xcli
Quick start
package main
import (
"github.com/mix-go/xcli"
"github.com/mix-go/xcli/flag"
)
func main() {
xcli.SetName("app").SetVersion("0.0.0-alpha")
cmd := &xcli.Command{
Name: "hello",
Short: "Echo demo",
Run: func() {
name := flag.Match("n", "name")