pkg: github.com/palantir/pkg/cli/flag Index | Files

package flag

import "github.com/palantir/pkg/cli/flag"

Index

Package Files

bool_flag.go duration_flag.go flag.go int_flag.go names.go slice.go string_flag.go string_param.go

func DurationProvider Uses

func DurationProvider(ctx *completion.ProviderCtx) []string

func WithPrefix Uses

func WithPrefix(name string) string

type BoolFlag Uses

type BoolFlag struct {
    Name       string
    Alias      string
    Value      bool
    Usage      string
    EnvVar     string
    Deprecated string
}

func (BoolFlag) Default Uses

func (f BoolFlag) Default() interface{}

func (BoolFlag) DefaultStr Uses

func (f BoolFlag) DefaultStr() string

func (BoolFlag) DeprecationStr Uses

func (f BoolFlag) DeprecationStr() string

func (BoolFlag) EnvVarStr Uses

func (f BoolFlag) EnvVarStr() string

func (BoolFlag) FullNames Uses

func (f BoolFlag) FullNames() []string

func (BoolFlag) HasLeader Uses

func (f BoolFlag) HasLeader() bool

func (BoolFlag) IsRequired Uses

func (f BoolFlag) IsRequired() bool

func (BoolFlag) MainName Uses

func (f BoolFlag) MainName() string

func (BoolFlag) Parse Uses

func (f BoolFlag) Parse(str string) (interface{}, error)

func (BoolFlag) PlaceholderStr Uses

func (f BoolFlag) PlaceholderStr() string

func (BoolFlag) UsageStr Uses

func (f BoolFlag) UsageStr() string

type DurationFlag Uses

type DurationFlag struct {
    Name  string
    Alias string
    // Value is string instead of time.Duration so help can format it
    // however makes sense, like 120s instead of 2m0s
    Value      string
    Usage      string
    EnvVar     string
    Required   bool
    Deprecated string
}

func (DurationFlag) Default Uses

func (f DurationFlag) Default() interface{}

func (DurationFlag) DefaultStr Uses

func (f DurationFlag) DefaultStr() string

func (DurationFlag) DeprecationStr Uses

func (f DurationFlag) DeprecationStr() string

func (DurationFlag) EnvVarStr Uses

func (f DurationFlag) EnvVarStr() string

func (DurationFlag) FullNames Uses

func (f DurationFlag) FullNames() []string

func (DurationFlag) HasLeader Uses

func (f DurationFlag) HasLeader() bool

func (DurationFlag) IsRequired Uses

func (f DurationFlag) IsRequired() bool

func (DurationFlag) MainName Uses

func (f DurationFlag) MainName() string

func (DurationFlag) Parse Uses

func (f DurationFlag) Parse(str string) (interface{}, error)

func (DurationFlag) PlaceholderStr Uses

func (f DurationFlag) PlaceholderStr() string

func (DurationFlag) UsageStr Uses

func (f DurationFlag) UsageStr() string

type Flag Uses

type Flag interface {
    MainName() string    // without hyphens
    FullNames() []string // with hyphens
    IsRequired() bool
    DeprecationStr() string
    HasLeader() bool

    Default() interface{} // must not be called if flag is required
    Parse(string) (interface{}, error)

    PlaceholderStr() string // must not be called on bool flag
    DefaultStr() string     // must not be called if flag is required
    EnvVarStr() string      // must not be called if flag is required
    UsageStr() string
}

type IntFlag Uses

type IntFlag struct {
    Name       string
    Alias      string
    Value      int
    Usage      string
    EnvVar     string
    Required   bool
    Deprecated string
}

func (IntFlag) Default Uses

func (f IntFlag) Default() interface{}

func (IntFlag) DefaultStr Uses

func (f IntFlag) DefaultStr() string

func (IntFlag) DeprecationStr Uses

func (f IntFlag) DeprecationStr() string

func (IntFlag) EnvVarStr Uses

func (f IntFlag) EnvVarStr() string

func (IntFlag) FullNames Uses

func (f IntFlag) FullNames() []string

func (IntFlag) HasLeader Uses

func (f IntFlag) HasLeader() bool

func (IntFlag) IsRequired Uses

func (f IntFlag) IsRequired() bool

func (IntFlag) MainName Uses

func (f IntFlag) MainName() string

func (IntFlag) Parse Uses

func (f IntFlag) Parse(str string) (interface{}, error)

func (IntFlag) PlaceholderStr Uses

func (f IntFlag) PlaceholderStr() string

func (IntFlag) UsageStr Uses

func (f IntFlag) UsageStr() string

type StringFlag Uses

type StringFlag struct {
    Name        string
    Alias       string
    Value       string
    Usage       string
    Placeholder string
    EnvVar      string
    Required    bool
    Deprecated  string
}

func (StringFlag) Default Uses

func (f StringFlag) Default() interface{}

func (StringFlag) DefaultStr Uses

func (f StringFlag) DefaultStr() string

func (StringFlag) DeprecationStr Uses

func (f StringFlag) DeprecationStr() string

func (StringFlag) EnvVarStr Uses

func (f StringFlag) EnvVarStr() string

func (StringFlag) FullNames Uses

func (f StringFlag) FullNames() []string

func (StringFlag) HasLeader Uses

func (f StringFlag) HasLeader() bool

func (StringFlag) IsRequired Uses

func (f StringFlag) IsRequired() bool

func (StringFlag) MainName Uses

func (f StringFlag) MainName() string

func (StringFlag) Parse Uses

func (f StringFlag) Parse(str string) (interface{}, error)

func (StringFlag) PlaceholderStr Uses

func (f StringFlag) PlaceholderStr() string

func (StringFlag) UsageStr Uses

func (f StringFlag) UsageStr() string

type StringParam Uses

type StringParam struct {
    Name  string
    Usage string
}

func (StringParam) Default Uses

func (f StringParam) Default() interface{}

func (StringParam) DefaultStr Uses

func (f StringParam) DefaultStr() string

func (StringParam) DeprecationStr Uses

func (f StringParam) DeprecationStr() string

func (StringParam) EnvVarStr Uses

func (f StringParam) EnvVarStr() string

func (StringParam) FullNames Uses

func (f StringParam) FullNames() []string

func (StringParam) HasLeader Uses

func (f StringParam) HasLeader() bool

func (StringParam) IsRequired Uses

func (f StringParam) IsRequired() bool

func (StringParam) MainName Uses

func (f StringParam) MainName() string

func (StringParam) Parse Uses

func (f StringParam) Parse(str string) (interface{}, error)

func (StringParam) PlaceholderStr Uses

func (f StringParam) PlaceholderStr() string

func (StringParam) UsageStr Uses

func (f StringParam) UsageStr() string

type StringSlice Uses

type StringSlice struct {
    Name     string
    Usage    string
    Optional bool
}

func (StringSlice) Default Uses

func (f StringSlice) Default() interface{}

func (StringSlice) DefaultStr Uses

func (f StringSlice) DefaultStr() string

func (StringSlice) DeprecationStr Uses

func (f StringSlice) DeprecationStr() string

func (StringSlice) EnvVarStr Uses

func (f StringSlice) EnvVarStr() string

func (StringSlice) FullNames Uses

func (f StringSlice) FullNames() []string

func (StringSlice) HasLeader Uses

func (f StringSlice) HasLeader() bool

func (StringSlice) IsRequired Uses

func (f StringSlice) IsRequired() bool

func (StringSlice) MainName Uses

func (f StringSlice) MainName() string

func (StringSlice) Parse Uses

func (f StringSlice) Parse(str string) (interface{}, error)

func (StringSlice) PlaceholderStr Uses

func (f StringSlice) PlaceholderStr() string

func (StringSlice) UsageStr Uses

func (f StringSlice) UsageStr() string

Package flag imports 6 packages (graph) and is imported by 22 packages. Updated 2018-08-24. Refresh now. Tools for package owners.