feat(cli): new version format with commit hash and go version

This commit is contained in:
Hintay 2025-02-05 14:25:50 +09:00
parent 071c22a881
commit 07eba99f2b
No known key found for this signature in database
GPG key ID: 120FC7FF121F2F2D
5 changed files with 73 additions and 5 deletions

View file

@ -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)