flag

package
v0.0.0-...-791c77c Latest Latest
Warning

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

Go to latest
Published: May 11, 2025 License: MIT Imports: 4 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Flag

type Flag struct {
	flag_policy.FlagPolicy
	// contains filtered or unexported fields
}

func Make

func Make(
	fp flag_policy.FlagPolicy,
	stringer func() string,
	set func(string) error,
	reset func(),
) Flag

func (Flag) Set

func (f Flag) Set(v string) (err error)

func (Flag) String

func (f Flag) String() string

type FlagSet

type FlagSet = flag.FlagSet

type ResettingFlag

type ResettingFlag[T interface {
	interfaces.Stringer
},
	TPtr interface {
		interfaces.SetterPtr[T]
		Reset()
	},
] struct {
	// contains filtered or unexported fields
}

func MakeResettingFlag

func MakeResettingFlag[T interface {
	interfaces.Stringer
},
	TPtr interface {
		interfaces.SetterPtr[T]
		Reset()
	},
](e T) ResettingFlag[T, TPtr]

func (ResettingFlag[T, TPtr]) GetFlag

func (g ResettingFlag[T, TPtr]) GetFlag() T

func (*ResettingFlag[T, TPtr]) GetFlagPtr

func (g *ResettingFlag[T, TPtr]) GetFlagPtr() TPtr

func (*ResettingFlag[T, TPtr]) Set

func (g *ResettingFlag[T, TPtr]) Set(v string) (err error)

func (*ResettingFlag[T, TPtr]) String

func (g *ResettingFlag[T, TPtr]) String() string

type Value

type Value = flag.Value

Jump to

Keyboard shortcuts

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