flag

package
v0.58.3 Latest Latest
Warning

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

Go to latest
Published: May 9, 2024 License: Apache-2.0 Imports: 2 Imported by: 17

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func NewOptionalIntValue

func NewOptionalIntValue(p *OptionalInt) pflag.Value

NewOptionalIntValue returns the pflag.Value of the int.

func NewOptionalStringValue

func NewOptionalStringValue(p *OptionalString) pflag.Value

NewOptionalStringValue returns a pflag.Value for the string.

func OptionalBoolFlag

func OptionalBoolFlag(fs *pflag.FlagSet, p *OptionalBool, name, usage string) *pflag.Flag

OptionalBoolFlag creates new flag for an optional in the specified flag with the specified name and usage.

Types

type OptionalBool

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

OptionalBool is a boolean with a separate presence flag and value.

func (*OptionalBool) Present

func (ob *OptionalBool) Present() bool

Present returns the bool's presence flag.

func (*OptionalBool) Value

func (ob *OptionalBool) Value() bool

Present returns the bool's value. Should only be used if Present() is true.

type OptionalInt

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

OptionalInt is a int with a separate presence flag.

func (*OptionalInt) Present

func (oi *OptionalInt) Present() bool

Present returns the int's presence flag.

func (*OptionalInt) Value

func (oi *OptionalInt) Value() int

Present returns the int's value. Should only be used if Present() is true.

type OptionalString

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

OptionalString is a string with a separate presence flag.

func (*OptionalString) Present

func (os *OptionalString) Present() bool

Present returns the strings's presence flag.

func (*OptionalString) Value

func (os *OptionalString) Value() string

Present returns the string's value. Should only be used if Present() is true.

Jump to

Keyboard shortcuts

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