feat: use -version for version
All checks were successful
build / build (push) Successful in 1m16s
build / trigger-build-image (push) Successful in 6s

This commit is contained in:
张泊明518370910136 2024-10-01 01:15:31 -04:00
parent ff8f700506
commit 0826a3d14a
GPG Key ID: D47306D7062CDA9D
4 changed files with 4 additions and 4 deletions

View File

@ -39,7 +39,7 @@ jobs:
- name: Build - name: Build
run: make build run: make build
- name: Version - name: Version
run: ./build/joj3 -v run: ./build/joj3 -version
- name: Test - name: Test
run: | run: |
make prepare-test make prepare-test

View File

@ -40,7 +40,7 @@ var Version string
// Generally, err is used for runtime errors, and checkRes is used for the result of the checks. // Generally, err is used for runtime errors, and checkRes is used for the result of the checks.
func main() { func main() {
var gitWhitelist, metaFile, releaseTags []string var gitWhitelist, metaFile, releaseTags []string
showVersion := flag.Bool("v", false, "print current version") showVersion := flag.Bool("version", false, "print current version")
rootDir := flag.String("root", "", "") rootDir := flag.String("root", "", "")
repo := flag.String("repo", "", "") repo := flag.String("repo", "", "")
localList := flag.String("localList", "", "") localList := flag.String("localList", "", "")

View File

@ -100,7 +100,7 @@ var (
func init() { func init() {
flag.StringVar(&metaConfPath, "meta-conf", "meta-conf.toml", "meta config file path") flag.StringVar(&metaConfPath, "meta-conf", "meta-conf.toml", "meta config file path")
flag.StringVar(&msg, "msg", "", "message to trigger the running, leave empty to use git commit message on HEAD") flag.StringVar(&msg, "msg", "", "message to trigger the running, leave empty to use git commit message on HEAD")
showVersion = flag.Bool("v", false, "print current version") showVersion = flag.Bool("version", false, "print current version")
} }
func mainImpl() error { func mainImpl() error {

View File

@ -12,7 +12,7 @@ import (
var Version string var Version string
func main() { func main() {
showVersion := flag.Bool("v", false, "print current version") showVersion := flag.Bool("version", false, "print current version")
score := flag.Int("score", 0, "score") score := flag.Int("score", 0, "score")
flag.Parse() flag.Parse()
if *showVersion { if *showVersion {