This repository has been archived on 2022-08-17. You can view files and clone it, but cannot push or open issues or pull requests.
dex/cmd/dex/version.go
Mark Sagi-Kazar 6742008fc2
refactor: version command
Signed-off-by: Mark Sagi-Kazar <mark.sagikazar@gmail.com>
2021-01-14 15:55:07 +01:00

27 lines
443 B
Go

package main
import (
"fmt"
"runtime"
"github.com/spf13/cobra"
"github.com/dexidp/dex/version"
)
func commandVersion() *cobra.Command {
return &cobra.Command{
Use: "version",
Short: "Print the version and exit",
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,
)
},
}
}