version.go 462 B

1234567891011121314151617
  1. package cmd
  2. import (
  3. "fmt"
  4. "runtime"
  5. "github.com/0xJacky/Nginx-UI/internal/helper"
  6. "github.com/0xJacky/Nginx-UI/internal/version"
  7. "github.com/urfave/cli/v3"
  8. )
  9. func VersionPrinter(cmd *cli.Command) {
  10. fmt.Println(helper.Concat(
  11. cmd.Root().Name, " ", cmd.Root().Version, " ", version.BuildId, "(", version.TotalBuild, ") ",
  12. version.GetShortHash(), " (", runtime.Version(), " ", runtime.GOOS, "/", runtime.GOARCH, ")"))
  13. fmt.Println(cmd.Root().Usage)
  14. }