fleet/cli/version.go
Victor Vrantchan da05e360ac print version info (#164)
add version package and print version commands
make build now sets build info like git branch and revision when creating a binary.
2016-09-14 13:19:11 -04:00

31 lines
628 B
Go

package cli
import (
"github.com/kolide/kolide-ose/config"
"github.com/kolide/kolide-ose/version"
"github.com/spf13/cobra"
)
func createVersionCmd(configManager config.Manager) *cobra.Command {
// flags
var (
fFull bool
)
var versionCmd = &cobra.Command{
Use: "version",
Short: "Print kolide version",
Long: `
Print version information and related build info`,
Run: func(cmd *cobra.Command, args []string) {
if fFull {
version.PrintFull()
return
}
version.Print()
},
}
versionCmd.PersistentFlags().BoolVar(&fFull, "full", false, "print full version information")
return versionCmd
}