软件版本命令控制显示
Example
first use the library such as:
package main
import (
soft "github.com/zhangrxiang/soft-version/src"
)
func main() {
soft.NewCommand().Parse()
}
then open your terminal:
$ go build
$ ./[You Soft] init
update version.json file under your project,input your project info
{
"name": "xx-软件",
"alias": "别名",
"author": "作者",
"version": {
"version": "0.0.1",
"log": "init",
"status": "Base"
},
"copyright": "All rights reserved",
"inherit": true
}
after go on
$ ./[You Soft] build
$ go build
$ ./[You Soft] help
usage: xx-软件 [<flags>] <command> [<args> ...]
作者
Flags:
--help Show context-sensitive help (also try --help-long and --help-man)
.
Commands:
help [<command>...]
Show help.
run
运行xx-软件
version
xx-软件版本
full-version
xx-软件版本全称
info
xx-软件版本信息
build
开发编译[软件开发者专用]
init
初始化软件版本配置文件[软件开发者专用]