Book a Demo!
CoCalc Logo Icon
StoreFeaturesDocsShareSupportNewsAboutPoliciesSign UpSign In
gitpod-io
GitHub Repository: gitpod-io/gitpod
Path: blob/main/components/gitpod-cli/cmd/version.go
2498 views
1
// Copyright (c) 2022 Gitpod GmbH. All rights reserved.
2
// Licensed under the GNU Affero General Public License (AGPL).
3
// See License.AGPL.txt in the project root for license information.
4
5
package cmd
6
7
import (
8
_ "embed"
9
"fmt"
10
11
"github.com/gitpod-io/gitpod/gitpod-cli/pkg/gitpod"
12
13
"github.com/spf13/cobra"
14
)
15
16
// urlCmd represents the url command
17
var versionCmd = &cobra.Command{
18
Use: "version",
19
Hidden: false,
20
Short: "Prints the version of the CLI",
21
Args: cobra.MaximumNArgs(1),
22
RunE: func(cmd *cobra.Command, args []string) error {
23
fmt.Println(gitpod.Version)
24
return nil
25
},
26
}
27
28
func init() {
29
rootCmd.AddCommand(versionCmd)
30
}
31
32