mow.cli: github.com/jawher/mow.cli/internal/values Index | Files

package values

import "github.com/jawher/mow.cli/internal/values"

Index

Package Files

utils.go values.go

func IsBool Uses

func IsBool(v flag.Value) bool

IsBool checks if a given value is a bool value, i.e. implements the BoolValued interface

func SetFromEnv Uses

func SetFromEnv(into flag.Value, envVars string) bool

SetFromEnv fills a value from a list of env vars

type BoolValue Uses

type BoolValue bool

BoolValue is a flag.Value type holding boolean values

func NewBool Uses

func NewBool(into *bool, v bool) *BoolValue

NewBool creates a new bool value

func (*BoolValue) IsBoolFlag Uses

func (bo *BoolValue) IsBoolFlag() bool

IsBoolFlag returns true

func (*BoolValue) IsDefault Uses

func (bo *BoolValue) IsDefault() bool

IsDefault return true if the bool value is false

func (*BoolValue) Set Uses

func (bo *BoolValue) Set(s string) error

Set sets the value from a provided string

func (*BoolValue) String Uses

func (bo *BoolValue) String() string

type BoolValued Uses

type BoolValued interface {
    flag.Value
    // IsBoolFlag should return true to indicate that this value is a bool value
    IsBoolFlag() bool
}

BoolValued is an interface values can implement to indicate that they are a bool option, i.e. can be set without providing a value with just -f for example

type DefaultValued Uses

type DefaultValued interface {
    // IsDefault should return true if the value stored is the default value, and thus does not need be shown in the help message
    IsDefault() bool
}

DefaultValued in an interface to determine if the value stored is the default value, and thus does not need be shown in the help message

type Float64Value Uses

type Float64Value float64

Float64Value is a flag.Value type holding int values

func NewFloat64 Uses

func NewFloat64(into *float64, v float64) *Float64Value

NewFloat64 creates a new int value

func (*Float64Value) Set Uses

func (ia *Float64Value) Set(s string) error

Set sets the value from a provided string

func (*Float64Value) String Uses

func (ia *Float64Value) String() string

type Floats64Value Uses

type Floats64Value []float64

Floats64Value is a flag.Value type holding int values

func NewFloats64 Uses

func NewFloats64(into *[]float64, v []float64) *Floats64Value

NewFloats64 creates a new multi-int value

func (*Floats64Value) Clear Uses

func (ia *Floats64Value) Clear()

Clear clears the slice

func (*Floats64Value) IsDefault Uses

func (ia *Floats64Value) IsDefault() bool

IsDefault return true if the int slice is empty

func (*Floats64Value) Set Uses

func (ia *Floats64Value) Set(s string) error

Set sets the value from a provided string

func (*Floats64Value) String Uses

func (ia *Floats64Value) String() string

type IntValue Uses

type IntValue int

IntValue is a flag.Value type holding int values

func NewInt Uses

func NewInt(into *int, v int) *IntValue

NewInt creates a new int value

func (*IntValue) Set Uses

func (ia *IntValue) Set(s string) error

Set sets the value from a provided string

func (*IntValue) String Uses

func (ia *IntValue) String() string

type IntsValue Uses

type IntsValue []int

IntsValue is a flag.Value type holding int values

func NewInts Uses

func NewInts(into *[]int, v []int) *IntsValue

NewInts creates a new multi-int value

func (*IntsValue) Clear Uses

func (ia *IntsValue) Clear()

Clear clears the slice

func (*IntsValue) IsDefault Uses

func (ia *IntsValue) IsDefault() bool

IsDefault return true if the int slice is empty

func (*IntsValue) Set Uses

func (ia *IntsValue) Set(s string) error

Set sets the value from a provided string

func (*IntsValue) String Uses

func (ia *IntsValue) String() string

type MultiValued Uses

type MultiValued interface {
    flag.Value
    // Clear should clear the list of values
    Clear()
}

MultiValued is an interface ti indicate that a value can hold multiple values

type StringValue Uses

type StringValue string

StringValue is a flag.Value type holding string values

func NewString Uses

func NewString(into *string, v string) *StringValue

NewString creates a new string value

func (*StringValue) IsDefault Uses

func (sa *StringValue) IsDefault() bool

IsDefault return true if the string value is empty

func (*StringValue) Set Uses

func (sa *StringValue) Set(s string) error

Set sets the value from a provided string

func (*StringValue) String Uses

func (sa *StringValue) String() string

type StringsValue Uses

type StringsValue []string

StringsValue is a flag.Value type holding string slices values

func NewStrings Uses

func NewStrings(into *[]string, v []string) *StringsValue

NewStrings creates a new multi-string value

func (*StringsValue) Clear Uses

func (sa *StringsValue) Clear()

Clear clears the slice

func (*StringsValue) IsDefault Uses

func (sa *StringsValue) IsDefault() bool

IsDefault return true if the string slice is empty

func (*StringsValue) Set Uses

func (sa *StringsValue) Set(s string) error

Set sets the value from a provided string

func (*StringsValue) String Uses

func (sa *StringsValue) String() string

Package values imports 5 packages (graph) and is imported by 6 packages. Updated 2019-06-30. Refresh now. Tools for package owners.