24 lines
352 B
Go
24 lines
352 B
Go
package cmd
|
|
|
|
import (
|
|
"os"
|
|
|
|
"github.com/spf13/cobra"
|
|
)
|
|
|
|
const version = "0.0.2"
|
|
|
|
var versionCmd = &cobra.Command{
|
|
Use: "version",
|
|
Short: "Print the version number of gotygen",
|
|
Run: func(cmd *cobra.Command, args []string) {
|
|
cmd.Println("gotygen v", version)
|
|
},
|
|
}
|
|
|
|
func init() {
|
|
versionCmd.SetOut(os.Stdout)
|
|
|
|
rootCmd.AddCommand(versionCmd)
|
|
}
|