github.com/kubeshop/testkube@v1.17.23/cmd/tools/commands/root.go (about)

     1  package commands
     2  
     3  import (
     4  	"fmt"
     5  	"os"
     6  
     7  	"github.com/spf13/cobra"
     8  
     9  	"github.com/kubeshop/testkube/pkg/ui"
    10  )
    11  
    12  var (
    13  	Commit  string
    14  	Version string
    15  	BuiltBy string
    16  	Date    string
    17  )
    18  
    19  func init() {
    20  	RootCmd.AddCommand(NewReleaseCmd())
    21  	RootCmd.AddCommand(NewVersionBumpCmd())
    22  }
    23  
    24  var RootCmd = &cobra.Command{
    25  	Use:   "",
    26  	Short: "tools command",
    27  	Long:  `tools command`,
    28  	Run: func(cmd *cobra.Command, args []string) {
    29  		ui.Logo()
    30  		err := cmd.Usage()
    31  		ui.PrintOnError("Displaying usage", err)
    32  		cmd.DisableAutoGenTag = true
    33  	},
    34  }
    35  
    36  func Execute() {
    37  	if err := RootCmd.Execute(); err != nil {
    38  		fmt.Fprintln(os.Stderr, err)
    39  		os.Exit(1)
    40  	}
    41  }