github.com/esnet/gdg@v0.6.1-0.20240412190737-6b6eba9c14d8/cmd/gdg-generate/cli/version.go (about)

     1  package cli
     2  
     3  import (
     4  	"github.com/esnet/gdg/internal/version"
     5  	"github.com/spf13/cobra"
     6  )
     7  
     8  var versionCmd = &cobra.Command{
     9  	Use:   "version",
    10  	Short: "Print the version number of gdg-generate",
    11  	Long:  `Print the version number of gdg-generate`,
    12  	Run: func(cmd *cobra.Command, args []string) {
    13  		version.PrintVersionInfo()
    14  	},
    15  }
    16  
    17  func init() {
    18  	rootCmd.AddCommand(versionCmd)
    19  }