2
0

version.go 381 B

123456789101112131415161718192021
  1. package cmd
  2. import (
  3. "fmt"
  4. "github.com/porter-dev/porter/cli/cmd/config"
  5. "github.com/spf13/cobra"
  6. )
  7. var versionCmd = &cobra.Command{
  8. Use: "version",
  9. Aliases: []string{"v", "--version"},
  10. Short: "Prints the version of the Porter CLI",
  11. Run: func(cmd *cobra.Command, args []string) {
  12. fmt.Println(config.Version)
  13. },
  14. }
  15. func init() {
  16. rootCmd.AddCommand(versionCmd)
  17. }