fleet/cli/version.go

32 lines
642 B
Go
Raw Normal View History

package cli
import (
2016-09-26 18:48:55 +00:00
"github.com/kolide/kolide-ose/server/config"
"github.com/kolide/kolide-ose/server/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
}