cmd

package
v1.106.2-alpha.1 Latest Latest
Warning

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

Go to latest
Published: Dec 5, 2024 License: BSD-3-Clause Imports: 40 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Execute

func Execute()

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.

func NewRootCMD

func NewRootCMD() *cobra.Command

NewRootCMD creates a rootCmd, which represents the base command when called without any subcommands.

func RunCmd added in v1.30.3

func RunCmd(ctx context.Context, v *viper.Viper, verbose bool, sendDiagsOnErrors bool, cmd cmdFn) error

RunCmd runs a command function and exits with the exit code returned by the command function. Will send diagnostic on any errors or panics.

func RunCmdWithOfflineSync added in v1.30.3

func RunCmdWithOfflineSync(ctx context.Context, v *viper.Viper, verbose bool, sendDiagsOnErrors bool, cmd cmdFn) error

RunCmdWithOfflineSync runs a command function and exits with the exit code returned by the command function. If command run was successful, it will execute offline sync command afterwards. Will send diagnostic on any errors or panics.

func RunE added in v1.97.1

func RunE(cmd *cobra.Command, v *viper.Viper) error

RunE executes commands parsed from a command line.

func SetupLogging added in v1.30.3

func SetupLogging(ctx context.Context, v *viper.Viper) (*log.Logger, error)

SetupLogging uses the --log-file param to configure logging to file or stdout. It returns a logger with the configured settings or the default settings if it's not set.

Types

This section is empty.

Jump to

Keyboard shortcuts

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