mirror of
https://github.com/0xJacky/nginx-ui.git
synced 2025-05-11 10:25:52 +02:00
feat(cli): new version format with commit hash and go version
This commit is contained in:
parent
071c22a881
commit
07eba99f2b
5 changed files with 73 additions and 5 deletions
|
@ -2,7 +2,6 @@ package cmd
|
|||
|
||||
import (
|
||||
"context"
|
||||
"fmt"
|
||||
"log"
|
||||
"os"
|
||||
|
||||
|
@ -37,9 +36,8 @@ func NewAppCmd() *cli.Command {
|
|||
Version: version.Version,
|
||||
}
|
||||
|
||||
cli.VersionPrinter = func(cmd *cli.Command) {
|
||||
fmt.Printf("%s (%d)\n", cmd.Root().Version, version.BuildId)
|
||||
}
|
||||
// Set the version printer
|
||||
cli.VersionPrinter = VersionPrinter
|
||||
|
||||
if err := cmd.Run(context.Background(), os.Args); err != nil {
|
||||
log.Fatal(err)
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue