flags

package
v1.2.0 Latest Latest
Warning

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

Go to latest
Published: Nov 1, 2026 License: BSD-3-Clause Imports: 7 Imported by: ? modules, 0 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

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