Book a Demo!
CoCalc Logo Icon
StoreFeaturesDocsShareSupportNewsAboutPoliciesSign UpSign In
gitpod-io
GitHub Repository: gitpod-io/gitpod
Path: blob/main/dev/gp-gcloud/cmd/root.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
"fmt"
9
"os"
10
11
"github.com/gitpod-io/gitpod/gp-gcloud/cmd/compute"
12
"github.com/spf13/cobra"
13
)
14
15
// rootCmd represents the base command when called without any subcommands
16
var rootCmd = &cobra.Command{
17
Use: "gp-gcloud",
18
Short: "Gcloud wrapper for internal gitpod usage",
19
Args: cobra.MinimumNArgs(1),
20
}
21
22
// Execute adds all child commands to the root command and sets flags appropriately.
23
// This is called by main.main(). It only needs to happen once to the rootCmd.
24
func Execute() {
25
if err := rootCmd.Execute(); err != nil {
26
fmt.Println(err)
27
os.Exit(1)
28
}
29
}
30
31
func init() {
32
rootCmd.AddCommand(compute.NewCommand())
33
}
34
35