cmd: add version subcommand to dexctl

closes #220
This commit is contained in:
Eric Chiang 2015-12-28 15:56:43 -08:00
parent 8e5115ce73
commit 22c20e4e32
2 changed files with 22 additions and 1 deletions

2
build
View file

@ -11,7 +11,7 @@ mkdir -p $GOPATH/src/github.com/coreos/
LD_FLAGS="-X main.version=$(./git-version)"
go build -o bin/dex-worker -ldflags="$LD_FLAGS" github.com/coreos/dex/cmd/dex-worker
go build -o bin/dexctl github.com/coreos/dex/cmd/dexctl
go build -o bin/dexctl -ldflags="$LD_FLAGS" github.com/coreos/dex/cmd/dexctl
go build -o bin/dex-overlord -ldflags="$LD_FLAGS" github.com/coreos/dex/cmd/dex-overlord
go build -o bin/example-app github.com/coreos/dex/examples/app
go build -o bin/example-cli github.com/coreos/dex/examples/cli

View file

@ -0,0 +1,21 @@
package main
import "github.com/spf13/cobra"
var (
// set by the top level build script
version = ""
cmdVersion = &cobra.Command{
Use: "version",
Short: "Print the dexctl version.",
Long: "Print the dexctl version.",
Run: func(cmd *cobra.Command, args []string) {
stdout(version)
},
}
)
func init() {
rootCmd.AddCommand(cmdVersion)
}