flag

package
v1.4.2-prerelease13 Latest Latest
Warning

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

Go to latest
Published: Sep 2, 2026 License: Apache-2.0 Imports: 4 Imported by: 2 modules, 1 package

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

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type RepeatedStringFlag added in v1.4.1

type RepeatedStringFlag struct {
	Name  string
	Usage string
}

RepeatedStringFlag is a cli.Flag for repeatable string values that does NOT split on commas. Each Apply creates a fresh StringSlice to prevent cross-run accumulation when the flag is defined as a package-level var.

func (*RepeatedStringFlag) Apply added in v1.4.1

func (f *RepeatedStringFlag) Apply(set *goflag.FlagSet) error

Apply registers a fresh StringSlice with the flag set on every call, preventing cross-run accumulation when the flag is a package-level var.

func (*RepeatedStringFlag) IsSet added in v1.4.1

func (f *RepeatedStringFlag) IsSet() bool

IsSet always returns false; c.IsSet() uses fs.Visit which is the authoritative check for whether the flag appeared on the command line.

func (*RepeatedStringFlag) IsVisible

func (f *RepeatedStringFlag) IsVisible() bool

IsVisible makes the flag appear in --help output; urfave/cli hides any flag that does not implement cli.VisibleFlag.

func (*RepeatedStringFlag) Names added in v1.4.1

func (f *RepeatedStringFlag) Names() []string

func (*RepeatedStringFlag) String added in v1.4.1

func (f *RepeatedStringFlag) String() string

type StringMap

type StringMap map[string]string

func (*StringMap) Set

func (m *StringMap) Set(value string) error

Set resets the map before parsing. This is intentional: StringMap is used as a GenericFlag.Value on package-level vars; without a reset, values from a previous app.Run() call accumulate into the next parse. The reset also makes Set idempotent when urfave/cli's normalizeFlags copies the flag value to aliases via Set(String()) — see String() below.

func (*StringMap) String

func (m *StringMap) String() string

String returns the map in key1=v1,key2=v2 format so that it round-trips cleanly through Set. urfave/cli's normalizeFlags propagates a flag's value to its aliases by calling Set(String()), so returning the Go default map representation (map[k:v]) would cause Set to fail and wipe the map.

func (*StringMap) Value

func (m *StringMap) Value() map[string]string

type StringSlice added in v1.4.1

type StringSlice []string

func (*StringSlice) Set added in v1.4.1

func (s *StringSlice) Set(value string) error

func (*StringSlice) String added in v1.4.1

func (s *StringSlice) String() string

func (*StringSlice) Value added in v1.4.1

func (s *StringSlice) Value() []string

Jump to

Keyboard shortcuts

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