flagutil

package
v0.7.4 Latest Latest
Warning

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

Go to latest
Published: Jun 18, 2025 License: Apache-2.0 Imports: 6 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type EnumFlag

type EnumFlag struct {
	// contains filtered or unexported fields
}

EnumFlag allows setting a list of values.

func NewEnumFlag

func NewEnumFlag(flagDescription string, allowedValues []string, defaultValue string) *EnumFlag

NewEnumFlag creates and returns an enum flag value with the given description, allowedValues and defaultValue.

func (*EnumFlag) Set

func (e *EnumFlag) Set(input string) error

Set implements pflag.Value.

func (*EnumFlag) String

func (e *EnumFlag) String() string

String implements pflag.Value. It is the preferred method of retrieving the set value for the enum.

func (*EnumFlag) Type

func (e *EnumFlag) Type() string

Type implements pflag.Value.

func (*EnumFlag) Usage

func (e *EnumFlag) Usage() string

Usage returns a string that can be used as help text for this flag. It will include the flag type and the list of allowed values.

Jump to

Keyboard shortcuts

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