实现类型go命令管理功能,方便管理子命令以及输出帮助信息等
Switch branches/tags
Nothing to show
Clone or download
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Permalink
Failed to load latest commit information.
command
.gitignore
README.md

README.md

command

实现类型go命令管理功能,方便管理子命令以及输出帮助信息等

使用方法

package main

import (
    "command"
)

var cmdInstall = &command.Command{
    UsageLine: "install [flags] [packages]",
    Short:     "compile and install packages and dependencies",
    Long: `
Install compiles and installs the packages named by the import paths,
along with their dependencies.
    `,
}

func init() {
    cmdInstall.Run = runInstall
}

func main() {
    usageLine := "autogo is a useful tool that helps building go projects automatically"
    commands := []*command.Command{
        cmdInstall,
    }
    command.InitProgram(usageLine, commands)
}

func runInstall(cmd *command.Command, args []string) {
}