Book a Demo!
CoCalc Logo Icon
StoreFeaturesDocsShareSupportNewsAboutPoliciesSign UpSign In
gitpod-io
GitHub Repository: gitpod-io/gitpod
Path: blob/main/dev/loadgen/cmd/root.go
2498 views
1
// Copyright (c) 2020 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/spf13/cobra"
12
)
13
14
// rootCmd represents the base command when called without any subcommands
15
var rootCmd = &cobra.Command{
16
Use: "loadgen",
17
Short: "Generates load on Gitpod installation",
18
}
19
20
// Execute adds all child commands to the root command and sets flags appropriately.
21
// This is called by main.main(). It only needs to happen once to the rootCmd.
22
func Execute() {
23
if err := rootCmd.Execute(); err != nil {
24
fmt.Println(err)
25
os.Exit(1)
26
}
27
}
28
29
func init() {
30
rootCmd.PersistentFlags().BoolVar(&runOpts.Interactive, "interactive", false, "loadgen will prompt before destructive actions")
31
}
32
33