Pudong Zheng 352393456b gitpod-cli: add analytics
Co-authored-by: Andrea Falzetti <andrea@gitpod.io>
2023-02-08 17:43:46 +01:00

31 lines
647 B
Go

// Copyright (c) 2022 Gitpod GmbH. All rights reserved.
// Licensed under the GNU Affero General Public License (AGPL).
// See License.AGPL.txt in the project root for license information.
package cmd
import (
_ "embed"
"fmt"
"github.com/gitpod-io/gitpod/gitpod-cli/pkg/gitpod"
"github.com/spf13/cobra"
)
// urlCmd represents the url command
var versionCmd = &cobra.Command{
Use: "version",
Hidden: false,
Short: "Prints the version of the CLI",
Args: cobra.MaximumNArgs(1),
RunE: func(cmd *cobra.Command, args []string) error {
fmt.Println(gitpod.Version)
return nil
},
}
func init() {
rootCmd.AddCommand(versionCmd)
}