Skip to content

Repository files navigation

Go Command

A wrapper library for Cobra CLI framework.

Install

go get -u github.com/InkShaStudio/go-command

Usage

package main
import (
"fmt""os""github.com/InkShaStudio/go-command"
)
funcmain() {
world:=command.
NewCommand("world").
ChangeDescription("hello world").
RegisterHandler(func(cmd*command.SCommand) {
fmt.Println("Hello World")
})
cmd:=command.RegisterCommand(
command.
NewCommand("hello").
ChangeDescription("hello world").
RegisterHandler(func(cmd*command.SCommand) {
}).
AddSubCommand(
world,
),
)
iferr:=cmd.Execute(); err!=nil {
fmt.Println(err)
os.Exit(1)
}
}

About

No description, website, or topics provided.

Resources

Stars

0 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages