version command impl

This commit is contained in:
Luke K 2020-04-09 16:31:07 +00:00
parent b313fc63e7
commit ef908a32bf
No known key found for this signature in database
GPG Key ID: 4896F75BAF2E1966
1 changed files with 21 additions and 0 deletions

21
cmd/version.go Normal file
View File

@ -0,0 +1,21 @@
package cmd
import (
"fmt"
"github.com/spf13/cobra"
)
func init() {
root.AddCommand(versionCmd)
}
var versionCmd = &cobra.Command{
Use: "version",
Short: "Print version",
Run: version,
}
func version(cmd *cobra.Command, args []string) {
fmt.Println(Version)
}