Documentation ¶
Index ¶
- Variables
- func BuildArgMatrix(args []string) ([][]string, error)
- func GetArgsCopy(cmd spec.Command) []string
- func IsInParamsForm(str string) bool
- func ParseArgArgs(ctx context.Context, cmd spec.Command, isBaseTarget bool, ...) (commandflag.ArgOpts, string, *string, error)
- func ParseArgs(command string, data interface{}, args []string) ([]string, error)
- func ParseArgsCleaned(cmdName string, opts interface{}, args []string) ([]string, error)
- func ParseArgsWithValueModifier(command string, data interface{}, args []string, ...) ([]string, error)
- func ParseArgsWithValueModifierAndOptions(command string, data interface{}, args []string, ...) ([]string, error)
- func ParseArgsWithValueModifierCleaned(cmdName string, opts interface{}, args []string, ...) ([]string, error)
- func ParseImageNameAndAttrs(s string) (string, map[string]string, error)
- func ParseLoad(loadStr string) (image string, target string, extraArgs []string, err error)
- func ParseParams(str string) (string, []string, error)
- func SplitFlagString(value cli.StringSlice) []string
- type ArgumentModFunc
- type ByteSizeValue
- type Duration
Constants ¶
This section is empty.
Variables ¶
var ErrGlobalArgNotInBase = errors.New("global ARG can only be set in the base target")
var ErrInvalidSyntax = errors.New("invalid syntax")
var ErrRequiredArgHasDefault = errors.New("required ARG cannot have a default value")
Functions ¶
func BuildArgMatrix ¶ added in v0.7.22
BuildArgMatrix builds a 2-dimensional slice of arguments that contains all combinations
func GetArgsCopy ¶ added in v0.7.21
func IsInParamsForm ¶ added in v0.7.21
func ParseArgArgs ¶ added in v0.7.21
func ParseArgArgs(ctx context.Context, cmd spec.Command, isBaseTarget bool, explicitGlobalFeature bool) (commandflag.ArgOpts, string, *string, error)
ParseArgArgs parses the ARG command's arguments and returns the argOpts, key, value (or nil if missing), or error
func ParseArgsCleaned ¶ added in v0.7.21
func ParseArgsWithValueModifier ¶
func ParseArgsWithValueModifier(command string, data interface{}, args []string, argumentModFunc ArgumentModFunc) ([]string, error)
ParseArgsWithValueModifier parses flags and args from a command string; it accepts an optional argumentModFunc which is called before each flag value is parsed, and allows one to change the value. if the flag value
func ParseArgsWithValueModifierAndOptions ¶ added in v0.6.24
func ParseArgsWithValueModifierAndOptions(command string, data interface{}, args []string, argumentModFunc ArgumentModFunc, parserOptions flags.Options) ([]string, error)
ParseArgsWithValueModifierAndOptions is similar to ParseArgsWithValueModifier, but allows changing the parser options.
func ParseArgsWithValueModifierCleaned ¶ added in v0.7.21
func ParseArgsWithValueModifierCleaned(cmdName string, opts interface{}, args []string, argumentModFunc ArgumentModFunc) ([]string, error)
func ParseImageNameAndAttrs ¶ added in v0.8.6
func ParseLoad ¶ added in v0.8.4
ParseLoad splits a --load value into the image, target, & extra args. Example: --load my-image=(+target --arg1 foo --arg2=bar)
func ParseParams ¶ added in v0.7.21
parseParams turns "(+target --flag=something)" into "+target" and []string{"--flag=something"}, or "\"(+target --flag=something)\"" into "+target" and []string{"--flag=something"}
func SplitFlagString ¶ added in v0.7.9
func SplitFlagString(value cli.StringSlice) []string
SplitFlagString would return an array of values from the StringSlice, whether it's passed using multiple occuranced of the flag or with the values passed with a command. For example: --platform linux/amd64 --platform linux/arm64 and --platform "linux/amd64,linux/arm64"
Types ¶
type ArgumentModFunc ¶
ArgumentModFunc accepts a flagName which corresponds to the long flag name, and a pointer to a flag value. The pointer is nil if no flag was given. the function returns a new pointer set to nil if one wants to pretend as if no value was given, or a pointer to a new value which will be parsed. Note: this was created to allow passing --no-cache=$SOME_VALUE; where we must expand $SOME_VALUE into a true/false value before it is parsed. If this feature is used extensively, then it might be time to completely fork go-flags with a version where we can include control over expansion struct tags.
type ByteSizeValue ¶ added in v0.7.21
type ByteSizeValue uint64
func (*ByteSizeValue) Set ¶ added in v0.7.21
func (b *ByteSizeValue) Set(s string) error
func (*ByteSizeValue) String ¶ added in v0.7.21
func (b *ByteSizeValue) String() string