mirror of
https://github.com/GMWalletApp/epusdt.git
synced 2026-07-07 10:16:15 +00:00
27 lines
492 B
Go
27 lines
492 B
Go
package command
|
|
|
|
import (
|
|
"fmt"
|
|
|
|
"github.com/GMWalletApp/epusdt/config"
|
|
"github.com/spf13/cobra"
|
|
)
|
|
|
|
var versionCmd = &cobra.Command{
|
|
Use: "version",
|
|
Short: "Print build version information",
|
|
RunE: func(cmd *cobra.Command, args []string) error {
|
|
_, err := fmt.Fprintf(cmd.OutOrStdout(),
|
|
"version: %s\ncommit: %s\nbuilt: %s\n",
|
|
config.GetAppVersion(),
|
|
config.GetBuildCommit(),
|
|
config.GetBuildDate(),
|
|
)
|
|
return err
|
|
},
|
|
}
|
|
|
|
func init() {
|
|
rootCmd.AddCommand(versionCmd)
|
|
}
|