flags

package
v1.0.0 Latest Latest
Warning

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

Go to latest
Published: May 29, 2020 License: MIT Imports: 5 Imported by: 1

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type BoolValue

type BoolValue bool

func (*BoolValue) Explicit

func (v *BoolValue) Explicit() bool

func (*BoolValue) Set

func (v *BoolValue) Set(nv string) (err error)

func (*BoolValue) String

func (v *BoolValue) String() string

type Float64Value

type Float64Value float64

func (*Float64Value) Explicit

func (v *Float64Value) Explicit() bool

func (*Float64Value) Set

func (v *Float64Value) Set(nv string) error

func (*Float64Value) String

func (v *Float64Value) String() string

type IntValue

type IntValue int

func (*IntValue) Explicit

func (v *IntValue) Explicit() bool

func (*IntValue) Set

func (v *IntValue) Set(nv string) error

func (*IntValue) String

func (v *IntValue) String() string

type Option

type Option struct {
	Name     string
	Usage    string
	Value    Value
	Optional bool
	Default  string
}

type Set

type Set struct {
	MissingValue *Option
	Out          io.Writer
	// contains filtered or unexported fields
}

func NewSet

func NewSet() *Set

func (*Set) Arg

func (s *Set) Arg(n int) string

func (*Set) Args

func (s *Set) Args() []string

func (*Set) Argument

func (s *Set) Argument(v Value, name, usage string, optional bool)

func (*Set) Bool

func (s *Set) Bool(name string, value bool, usage string, t *bool, optional bool) *bool

func (*Set) BoolArg

func (s *Set) BoolArg(name string, value bool, usage string, t *bool, optional bool) *bool

func (*Set) BoolVar

func (s *Set) BoolVar(target *bool, name string, value bool, usage string, positional bool, optional bool)

func (*Set) Float64

func (s *Set) Float64(name string, value float64, usage string, t *float64, optional bool) *float64

func (*Set) Float64Arg

func (s *Set) Float64Arg(name string, value float64, usage string, t *float64, optional bool) *float64

func (*Set) Float64Var

func (s *Set) Float64Var(target *float64, name string, value float64, usage string, positional bool, optional bool)

func (*Set) Int

func (s *Set) Int(name string, value int, usage string, t *int, optional bool) *int

func (*Set) IntArg

func (s *Set) IntArg(name string, value int, usage string, t *int, optional bool) *int

func (*Set) IntVar

func (s *Set) IntVar(target *int, name string, value int, usage string, positional bool, optional bool)

func (*Set) Lookup

func (s *Set) Lookup(name string) *Option

func (*Set) Parse

func (s *Set) Parse(args []string) (err error)

func (*Set) String

func (s *Set) String(name string, value string, usage string, t *string, optional bool) *string

func (*Set) StringArg

func (s *Set) StringArg(name string, value string, usage string, t *string, optional bool) *string

func (*Set) StringVar

func (s *Set) StringVar(target *string, name string, value string, usage string, positional bool, optional bool)

func (*Set) Var

func (s *Set) Var(v Value, name, usage string, optional bool)

type StringValue

type StringValue string

func (*StringValue) Explicit

func (v *StringValue) Explicit() bool

func (*StringValue) Set

func (v *StringValue) Set(nv string) error

func (*StringValue) String

func (v *StringValue) String() string

type Value

type Value interface {
	String() string
	Set(string) error
	Explicit() bool
}

Jump to

Keyboard shortcuts

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