2016-07-26 01:30:28 +05:30
|
|
|
package main
|
|
|
|
|
|
|
|
import (
|
|
|
|
"fmt"
|
|
|
|
"runtime"
|
|
|
|
|
|
|
|
"github.com/spf13/cobra"
|
|
|
|
)
|
|
|
|
|
2021-05-18 04:25:24 +05:30
|
|
|
var version = "DEV"
|
|
|
|
|
2016-07-26 01:30:28 +05:30
|
|
|
func commandVersion() *cobra.Command {
|
|
|
|
return &cobra.Command{
|
2016-08-10 03:08:09 +05:30
|
|
|
Use: "version",
|
|
|
|
Short: "Print the version and exit",
|
2021-01-14 20:25:07 +05:30
|
|
|
Run: func(_ *cobra.Command, _ []string) {
|
|
|
|
fmt.Printf(
|
|
|
|
"Dex Version: %s\nGo Version: %s\nGo OS/ARCH: %s %s\n",
|
2021-05-18 04:25:24 +05:30
|
|
|
version,
|
2021-01-14 20:25:07 +05:30
|
|
|
runtime.Version(),
|
|
|
|
runtime.GOOS,
|
|
|
|
runtime.GOARCH,
|
|
|
|
)
|
2016-07-26 01:30:28 +05:30
|
|
|
},
|
|
|
|
}
|
|
|
|
}
|