option

package
v1.7.2 Latest Latest
Warning

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

Go to latest
Published: Mar 13, 2024 License: Apache-2.0 Imports: 10 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func ApplyFlags

func ApplyFlags(optsPtr interface{}, target *pflag.FlagSet) error

ApplyFlags applies applicable fields of the passed-in option pointer to the target flag set. NOTE: The option argument need to be a pointer to the options, so its value becomes addressable.

func Parse

func Parse(optsPtr interface{}) error

Parse parses applicable fields of the passed-in option pointer and returns error during parsing.

Types

type Colors added in v0.1.12

type Colors struct {
	Green lipgloss.Style
	Red   lipgloss.Style
}

type Common

type Common struct {
	Debug    bool
	Verbose  bool
	NoColors bool
	Colors
}

func (*Common) ApplyFlags

func (opts *Common) ApplyFlags(fs *pflag.FlagSet)

func (*Common) Parse added in v0.1.21

func (opts *Common) Parse() error

type FlagApplier

type FlagApplier interface {
	ApplyFlags(*pflag.FlagSet)
}

FlagApplier applies flags to a command flag set.

type FlagParser

type FlagParser interface {
	Parse() error
}

FlagParser parses flags in an option.

type OCIRepository

type OCIRepository struct {
	CACertFilePath    string
	UsePlainHTTP      bool
	UseInsecure       bool
	Configs           []string
	Username          string
	PasswordFromStdin bool
	Password          string
}

func (*OCIRepository) ApplyFlags

func (opts *OCIRepository) ApplyFlags(fs *pflag.FlagSet)

func (*OCIRepository) Parse

func (opts *OCIRepository) Parse() error

Parse tries to read password with optional cmd prompt.

func (*OCIRepository) Repository added in v0.1.14

func (opts *OCIRepository) Repository(url string) oci.Repository

type Values

type Values struct {
	ReuseOtherSauceValues     bool
	NoInput                   bool
	CSVDelimiter              rune
	Flags                     []string
	ParseEnvironmentVariables bool
	// contains filtered or unexported fields
}

func (*Values) ApplyFlags

func (opts *Values) ApplyFlags(fs *pflag.FlagSet)

func (*Values) Parse added in v0.1.12

func (opts *Values) Parse() error

type WorkingDirectory

type WorkingDirectory struct {
	Dir string
}

func (*WorkingDirectory) ApplyFlags

func (opts *WorkingDirectory) ApplyFlags(fs *pflag.FlagSet)

Jump to

Keyboard shortcuts

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