32 lines
559 B
Go
32 lines
559 B
Go
package cmd
|
|
|
|
import (
|
|
"fmt"
|
|
|
|
"github.com/spf13/cobra"
|
|
)
|
|
|
|
const (
|
|
//ApplicationName displays name of the app
|
|
ApplicationName = "feeder"
|
|
)
|
|
|
|
var (
|
|
//ApplicationVersion displays version of the app
|
|
ApplicationVersion = ""
|
|
)
|
|
|
|
// versionCmd represents the version command
|
|
var versionCmd = &cobra.Command{
|
|
Use: "version",
|
|
Short: "Display feeder's version",
|
|
Long: `Display feeder's version`,
|
|
Run: func(cmd *cobra.Command, args []string) {
|
|
fmt.Printf("%v-%v\n", ApplicationName, ApplicationVersion)
|
|
},
|
|
}
|
|
|
|
func init() {
|
|
rootCmd.AddCommand(versionCmd)
|
|
}
|