refactor: version command

Signed-off-by: Mark Sagi-Kazar <mark.sagikazar@gmail.com>
This commit is contained in:
Mark Sagi-Kazar 2021-01-14 15:55:07 +01:00
parent c55d84b5d2
commit 6742008fc2
No known key found for this signature in database
GPG Key ID: 34CC109EB5ED1C2A
1 changed files with 8 additions and 5 deletions

View File

@ -13,11 +13,14 @@ func commandVersion() *cobra.Command {
return &cobra.Command{
Use: "version",
Short: "Print the version and exit",
Run: func(cmd *cobra.Command, args []string) {
fmt.Printf(`dex Version: %s
Go Version: %s
Go OS/ARCH: %s %s
`, version.Version, runtime.Version(), runtime.GOOS, runtime.GOARCH)
Run: func(_ *cobra.Command, _ []string) {
fmt.Printf(
"Dex Version: %s\nGo Version: %s\nGo OS/ARCH: %s %s\n",
version.Version,
runtime.Version(),
runtime.GOOS,
runtime.GOARCH,
)
},
}
}