flags

package
v1.13.1 Latest Latest
Warning

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

Go to latest
Published: Apr 4, 2026 License: MPL-2.0 Imports: 3 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func FlagIsSet

func FlagIsSet(flags *flag.FlagSet, name string) bool

FlagIsSet returns whether a flag is explicitly set in a set of flags

Types

type FlagStringKV

type FlagStringKV map[string]string

FlagStringKV is a flag.Value implementation for parsing user variables from the command-line in the format of '-var key=value', where value is only ever a primitive.

func (*FlagStringKV) Set

func (v *FlagStringKV) Set(raw string) error

func (*FlagStringKV) String

func (v *FlagStringKV) String() string

type FlagStringSlice

type FlagStringSlice []string

FlagStringSlice is a flag.Value implementation which allows collecting multiple instances of a single flag into a slice. This is used for flags such as -target=aws_instance.foo and -var x=y.

func (*FlagStringSlice) Set

func (v *FlagStringSlice) Set(raw string) error

func (*FlagStringSlice) String

func (v *FlagStringSlice) String() string

type RawFlag

type RawFlag struct {
	Name  string
	Value string
}

func (RawFlag) String

func (f RawFlag) String() string

type RawFlags

type RawFlags struct {
	Name  string
	Items *[]RawFlag
}

RawFlags is a flag.Value implementation that appends raw flag names and values to a slice. This is used to collect a sequence of flags with possibly different names, preserving the overall order.

func NewRawFlags

func NewRawFlags(name string) RawFlags

func (RawFlags) Alias

func (f RawFlags) Alias(flagName string) RawFlags

func (RawFlags) AllItems

func (f RawFlags) AllItems() []RawFlag

func (RawFlags) Empty

func (f RawFlags) Empty() bool

func (RawFlags) Set

func (f RawFlags) Set(str string) error

func (RawFlags) String

func (f RawFlags) String() string

Jump to

Keyboard shortcuts

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