github.com/jacobsoderblom/buffalo@v0.11.0/buffalo/cmd/version.go (about)

     1  package cmd
     2  
     3  import (
     4  	"github.com/sirupsen/logrus"
     5  	"github.com/spf13/cobra"
     6  )
     7  
     8  // Version is the current version of the buffalo binary
     9  const Version = "v0.11.0"
    10  
    11  func init() {
    12  	decorate("version", versionCmd)
    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  		logrus.Infof("Buffalo version is: %s\n", Version)
    22  	},
    23  	// needed to override the root level pre-run func
    24  	PersistentPreRunE: func(c *cobra.Command, args []string) error {
    25  		return nil
    26  	},
    27  }