flags

package
v0.1.1 Latest Latest
Warning

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

Go to latest
Published: Aug 8, 2023 License: MIT Imports: 7 Imported by: 0

Documentation

Index

Constants

View Source
const ColorNever = "never"

Variables

View Source
var Color = &cli.StringFlag{
	Name:        "color",
	DefaultText: "auto",
	EnvVars:     []string{"TAU_COLOR"},
}
View Source
var ColorOptions = []string{"never", "auto"}
View Source
var (
	DefaultInverseBoolPrefix = "no-"
)

Functions

func Combine

func Combine(flags ...interface{}) []cli.Flag

func GetColor

func GetColor(c *cli.Context) (color string, err error)

func ToUpper

func ToUpper(c *cli.Context, flags ...*cli.StringFlag)

ToUpper takes a slice of StringFlag sets the values each flag to upper case if the flag is set

Types

type BoolWithInverse

type BoolWithInverse interface {
	Value(ctx *cli.Context) bool
	IsSet(ctx *cli.Context) bool
}

type BoolWithInverseFlag

type BoolWithInverseFlag struct {
	// The BoolFlag which the positive and negative flags are generated from
	*cli.BoolFlag

	// The prefix used to indicate a negative value
	// Default: `env` becomes `no-env`
	InversePrefix string
	// contains filtered or unexported fields
}

func (*BoolWithInverseFlag) Apply

func (s *BoolWithInverseFlag) Apply(set *flag.FlagSet) error

func (*BoolWithInverseFlag) Flags

func (s *BoolWithInverseFlag) Flags() []cli.Flag

func (*BoolWithInverseFlag) IsSet

func (s *BoolWithInverseFlag) IsSet() bool

func (*BoolWithInverseFlag) Names

func (s *BoolWithInverseFlag) Names() []string

func (*BoolWithInverseFlag) RunAction

func (s *BoolWithInverseFlag) RunAction(ctx *cli.Context) error

func (*BoolWithInverseFlag) String

func (s *BoolWithInverseFlag) String() string

Example for BoolFlag{Name: "env"} --env | --no-env Usage...

func (*BoolWithInverseFlag) Value

func (s *BoolWithInverseFlag) Value() bool

Jump to

Keyboard shortcuts

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