From b7aea958f385a1c8c879d4b9762f45be3c19391d Mon Sep 17 00:00:00 2001 From: kev <31861128+yqlbu@users.noreply.github.com> Date: Wed, 15 Nov 2023 14:58:52 +0800 Subject: [PATCH] feat(cmd): extend --version print info (#356) --- cmd/cmd.go | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/cmd/cmd.go b/cmd/cmd.go index a7201d9..09874f6 100644 --- a/cmd/cmd.go +++ b/cmd/cmd.go @@ -1,6 +1,10 @@ package cmd import ( + "fmt" + "runtime" + "strings" + "github.com/daeuniverse/dae/config" "github.com/spf13/cobra" ) @@ -24,6 +28,12 @@ var ( func init() { config.Version = Version + rootCmd.Version = strings.Join([]string{ + Version, + fmt.Sprintf("go runtime %v %v/%v", runtime.Version(), runtime.GOOS, runtime.GOARCH), + "Copyright (c) 2023 dae", + "License GNU AGPLv3 ", + }, "\n") } // Execute executes the root command.