go_mode_flag

package module
v0.3.1 Latest Latest
Warning

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

Go to latest
Published: Jan 5, 2025 License: GPL-3.0 Imports: 3 Imported by: 1

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func SetFlag added in v0.3.0

func SetFlag(value flag.Value, name string, usage string)

SetFlag sets the mode flag

Types

type Flag

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

Flag is a custom flag type

func NewFlag

func NewFlag(value string, allowed []string) *Flag

NewFlag creates a new Flag

func (*Flag) Allowed

func (f *Flag) Allowed() []string

Allowed returns the allowed values

func (*Flag) Set

func (f *Flag) Set(value string) error

Set validates and sets the flag value

func (*Flag) String

func (f *Flag) String() string

String returns the string representation of the flag value

func (*Flag) Value

func (f *Flag) Value() string

Value returns the flag value

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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