2
0

version.go 429 B

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