flags

package
v0.86.0 Latest Latest
Warning

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

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

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func IsSet

func IsSet(short, long string, args []string) bool

IsSet can be used to check if a flag is set in a set of arguments. Both "long" and "short" flag names must be passed.

func LoadFlagsWithDefaults

func LoadFlagsWithDefaults(options KilnfileOptions, args []string, stat StatFunc) ([]string, error)

LoadFlagsWithDefaults only sets default values if the flag is not set this permits explicitly setting "zero values" for in arguments without them being overwritten.

func ToStrings added in v0.78.0

func ToStrings[t any](v t) []string

Types

type FetchBakeOptions added in v0.78.0

type FetchBakeOptions struct {
	DownloadThreads              int  `short:"dt" long:"download-threads" description:"number of parallel threads to download parts from S3"`
	NoConfirm                    bool `` /* 139-byte string literal not displayed */
	AllowOnlyPublishableReleases bool `` /* 146-byte string literal not displayed */
}

type FileSystem added in v0.78.0

type FileSystem interface {
	billy.Basic
	billy.Dir
}

type HomeDirFunc added in v0.78.0

type HomeDirFunc func() (string, error)

type KilnfileOptions

type KilnfileOptions interface {
	KilnfilePathPrefix() string
}

type Standard

type Standard struct {
	Kilnfile      string   `short:"kf"  long:"kilnfile"                   default:"Kilnfile"         description:"path to Kilnfile"`
	VariableFiles []string `` /* 137-byte string literal not displayed */
	Variables     []string `` /* 130-byte string literal not displayed */
}

func (Standard) KilnfileLockPath

func (options Standard) KilnfileLockPath() string

func (Standard) KilnfilePathPrefix

func (options Standard) KilnfilePathPrefix() string

func (*Standard) LoadKilnfiles

func (options *Standard) LoadKilnfiles(fsOverride billy.Basic, variablesServiceOverride VariablesService) (_ cargo.Kilnfile, _ cargo.KilnfileLock, err error)

LoadKilnfiles parses and interpolates the Kilnfile and parsed the Kilnfile.lock. The function parameters are for overriding default services. These parameters are helpful for testing, in most cases nil can be passed for both.

func (*Standard) SaveKilnfileLock

func (options *Standard) SaveKilnfileLock(fsOverride billy.Basic, kilnfileLock cargo.KilnfileLock) error

type StatFunc

type StatFunc func(string) (os.FileInfo, error)

type VariablesService

type VariablesService interface {
	FromPathsAndPairs(paths []string, pairs []string) (templateVariables map[string]any, err error)
}

Jump to

Keyboard shortcuts

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