github.com/jasonish/buffalo@v0.8.2-0.20170413145823-bacbdd415f1b/buffalo/cmd/version.go (about) 1 package cmd 2 3 import ( 4 "fmt" 5 6 "github.com/spf13/cobra" 7 ) 8 9 // Version is the current version of the buffalo binary 10 const Version = "0.8.1.2" 11 12 func init() { 13 RootCmd.AddCommand(versionCmd) 14 } 15 16 var versionCmd = &cobra.Command{ 17 Use: "version", 18 Short: "Print the version number of buffalo", 19 Long: `All software has versions. This is buffalo's.`, 20 Run: func(c *cobra.Command, args []string) { 21 fmt.Printf("Buffalo version is: %s\n", Version) 22 }, 23 // needed to override the root level pre-run func 24 PersistentPreRun: func(c *cobra.Command, args []string) { 25 }, 26 }