https://github.com/zing-dev/soft-version
soft-version
https://github.com/zing-dev/soft-version
Last synced: about 2 months ago
JSON representation
soft-version
- Host: GitHub
- URL: https://github.com/zing-dev/soft-version
- Owner: zing-dev
- License: bsd-3-clause
- Created: 2019-12-02T08:59:35.000Z (over 5 years ago)
- Default Branch: master
- Last Pushed: 2023-07-26T10:12:01.000Z (almost 2 years ago)
- Last Synced: 2025-02-02T05:41:20.069Z (4 months ago)
- Language: Go
- Size: 34.2 KB
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# 软件版本命令控制显示
## Example
first use the library such as:
```go
package mainimport (
_ "embed"
"github.com/urfave/cli/v2"
"github.com/zing-dev/soft-version/soft"
"os"
)//go:embed version.json
var str []bytefunc main() {
app := soft.Cli{App: cli.NewApp(),Src: str}
app.Run(os.Args)
}```
then open your terminal:
```shell script
$ go build$ ./[You Soft] init
```
update version.json file under your project,input your project info
```json
{
"name": "xx-软件",
"alias": "别名",
"author": "作者",
"version": {
"version": "0.0.1",
"log": "init",
"status": "Base"
},
"copyright": "All rights reserved",
"inherit": true
}
```
after go on
```shell script
$ ./[You Soft] build
$ go build
$ ./[You Soft] helpusage: xx-软件 [] [ ...]
作者
Flags:
--help Show context-sensitive help (also try --help-long and --help-man)
.Commands:
help [...]
Show help.run
运行xx-软件version
xx-软件版本full-version
xx-软件版本全称info
xx-软件版本信息build
开发编译[软件开发者专用]init
初始化软件版本配置文件[软件开发者专用]```