Book a Demo!
CoCalc Logo Icon
StoreFeaturesDocsShareSupportNewsAboutPoliciesSign UpSign In
gitpod-io
GitHub Repository: gitpod-io/gitpod
Path: blob/main/components/usage/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
"context"
9
"os"
10
11
"github.com/gitpod-io/gitpod/common-go/log"
12
"github.com/spf13/cobra"
13
)
14
15
var (
16
// ServiceName is the name we use for tracing/logging
17
ServiceName = "usage"
18
// Version of this service - set during build
19
Version = ""
20
)
21
22
// rootCmd represents the base command when called without any subcommands
23
var rootCmd = &cobra.Command{
24
Use: ServiceName,
25
Short: "Usage service & controller",
26
}
27
28
func Execute() {
29
if err := rootCmd.ExecuteContext(context.Background()); err != nil {
30
log.WithError(err).Error("Failed to execute command.")
31
os.Exit(1)
32
}
33
}
34
35