feat(cmd): extend --version print info (#356)

This commit is contained in:
kev 2023-11-15 14:58:52 +08:00 committed by GitHub
parent 25c047a766
commit b7aea958f3
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -1,6 +1,10 @@
package cmd package cmd
import ( import (
"fmt"
"runtime"
"strings"
"github.com/daeuniverse/dae/config" "github.com/daeuniverse/dae/config"
"github.com/spf13/cobra" "github.com/spf13/cobra"
) )
@ -24,6 +28,12 @@ var (
func init() { func init() {
config.Version = Version 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 <https://github.com/daeuniverse/dae/blob/main/LICENSE>",
}, "\n")
} }
// Execute executes the root command. // Execute executes the root command.