cmd

package
v1.13.0 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Apr 11, 2024 License: Apache-2.0 Imports: 29 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var RootCmd = &cobra.Command{
	Use:               "ecctl",
	Short:             "Elastic Cloud Control",
	SilenceErrors:     true,
	SilenceUsage:      true,
	DisableAutoGenTag: true,
	CompletionOptions: cobra.CompletionOptions{
		DisableDefaultCmd: true,
	},
	BashCompletionFunction: bashCompletionFunc,
	PersistentPreRunE: func(cmd *cobra.Command, args []string) error {
		setupViper(defaultViper)
		if err := setupDebug(defaultViper.GetBool("trace"), defaultViper.GetBool("pprof")); err != nil {
			return err
		}

		return initApp(cmd, defaultClient, defaultViper)
	},
}

RootCmd represents the base command when called without any subcommands

Functions

func Execute

func Execute(v ecctl.VersionInfo) int

Execute adds all child commands to the root command sets flags appropriately. This is called by main.main(). It only needs to happen once to the rootCmd. It returns the statuscode to be used by os.Exit.

func GetCommand

func GetCommand(command *cobra.Command, path ...string) *cobra.Command

GetCommand returns a child command from the command that is passed. If the command is not found, the parent is returned.

Types

This section is empty.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL