cli

package
v1.4.7 Latest Latest
Warning

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

Go to latest
Published: Dec 16, 2023 License: MIT Imports: 10 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var Logger = log.New(os.Stderr, "", 0)

Logger is a STDERR logger

View Source
var RootCmd = &cobra.Command{
	Use:   "deco",
	Short: "Gets stuff ready to run inside docker.",
	Long: `deco gets your app ready to run when a container
starts.  For example: the filters allow you to specify
individual files to filter and key/value pairs to use when
filtering.  By default, it works from the current directory and
will filter files in place.`,
	PersistentPreRunE: func(cmd *cobra.Command, args []string) error {

		if encryptionKey != "" {
			if err := os.Setenv("DECO_ENCRYPTION_KEY", encryptionKey); err != nil {
				return fmt.Errorf("failed to set DECO_ENCRYPTION_KEY environment: %s", err)
			}
		} else if value := os.Getenv("DECO_ENCRYPTION_KEY"); value != "" {
			encryptionKey = value
		}
		return nil
	},
}

RootCmd represents the base command when called without any subcommands

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.

Types

type CmdVersion

type CmdVersion struct {
	AppVersion string
	BuildTime  string
	GitCommit  string
	GitRef     string
}
var (
	Version *CmdVersion
)

Jump to

Keyboard shortcuts

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