cmd

package
v0.1.1 Latest Latest
Warning

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

Go to latest
Published: Jan 21, 2023 License: Apache-2.0 Imports: 13 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (

	// Root is the top-level cobra.Command for semvertagger.
	Root = &cobra.Command{
		Use:               commandName,
		Short:             commandName + " is a tool to remotely tag an image if it is the latest version",
		Run:               func(cmd *cobra.Command, _ []string) { _ = cmd.Usage() },
		DisableAutoGenTag: true,
		PersistentPreRun: func(cmd *cobra.Command, args []string) {
			if verbose {
				logs.Debug.SetOutput(os.Stderr)
			}
			if insecure {
				options = append(options, semvertagger.Insecure)
			}

			cf, err := config.Load(os.Getenv("DOCKER_CONFIG"))
			if err != nil {
				logs.Debug.Printf("failed to read config file: %v", err)
			} else if len(cf.HTTPHeaders) != 0 {
				options = append(options, semvertagger.WithTransport(&headerTransport{
					inner:       http.DefaultTransport,
					httpHeaders: cf.HTTPHeaders,
				}))
			}
		},
	}
)

Functions

func NewCmdLogin

func NewCmdLogin() *cobra.Command

NewCmdAuthLogin creates a new `crane auth login` command.

func NewCmdTag

func NewCmdTag(options *[]semvertagger.Option) *cobra.Command

NewCmdTag creates a new cobra.Command for the tag subcommand.

Types

This section is empty.

Jump to

Keyboard shortcuts

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