cmd

package
v0.0.0-...-7b8e0ff Latest Latest
Warning

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

Go to latest
Published: Oct 2, 2019 License: Apache-2.0 Imports: 16 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var RootCmd = &cobra.Command{
	Use:           "backyards",
	Short:         "Install and manage Backyards",
	SilenceErrors: true,
	SilenceUsage:  false,
	PersistentPreRunE: func(cmd *cobra.Command, args []string) error {
		cmd.SilenceUsage = true
		if verbose {
			log.SetLevel(log.DebugLevel)
		} else {
			log.SetLevel(log.InfoLevel)
		}

		namespaceFromEnv := os.Getenv("BACKYARDS_NAMESPACE")
		if backyardsNamespace == defaultNamespace && namespaceFromEnv != "" {
			backyardsNamespace = namespaceFromEnv
		}

		if !namespaceRegex.MatchString(backyardsNamespace) {
			return errors.NewWithDetails("invalid namespace", "namespace", backyardsNamespace)
		}

		return nil
	},
}

RootCmd represents the root Cobra command

Functions

func Execute

func Execute()

Execute adds all child commands to the root command and sets flags appropriately This is called by main.main(). It only needs to happen once to the RootCmd

func GetRootCommand

func GetRootCommand() *cobra.Command

GetRootCommand returns the cli root command

func Init

func Init(version string, commitHash string, buildDate string)

Init is a temporary function to set initial values in the root cmd

Types

This section is empty.

Jump to

Keyboard shortcuts

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