cli

package
v0.0.34 Latest Latest
Warning

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

Go to latest
Published: Jun 23, 2021 License: Apache-2.0 Imports: 45 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func DefaultUsageFunc

func DefaultUsageFunc(sf *SortedFlags, c *ffcli.Command, deprecatedFields []string) string

This is mostly copied from ffcli package

func Start

func Start(cfg *config.Config) error

Types

type FlagOption added in v0.0.34

type FlagOption func(*options)

func WithReplacement added in v0.0.34

func WithReplacement(k, v string) FlagOption

func WithSkip added in v0.0.34

func WithSkip(n ...string) FlagOption

func WithSkipDeprecated added in v0.0.34

func WithSkipDeprecated(ok bool) FlagOption

WithSkipDeprecated specifies that fields marked as deprecated won't be parsed. By default PopulateFlagSet parses them but not shows in Usage; setting this option to true causes PopulateFlagSet to skip parsing.

type SortedFlags added in v0.0.21

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

SortedFlags is needed because by default there's no way to provide order for flags

this is kind of an ugly workaround

func NewSortedFlags added in v0.0.21

func NewSortedFlags(obj interface{}, fs *flag.FlagSet, deprecatedFields []string) *SortedFlags

func PopulateFlagSet added in v0.0.21

func PopulateFlagSet(obj interface{}, flagSet *flag.FlagSet, opts ...FlagOption) *SortedFlags

func (*SortedFlags) Len added in v0.0.21

func (sf *SortedFlags) Len() int

func (*SortedFlags) Less added in v0.0.21

func (sf *SortedFlags) Less(i, j int) bool

func (*SortedFlags) Swap added in v0.0.21

func (sf *SortedFlags) Swap(i, j int)

func (*SortedFlags) VisitAll added in v0.0.21

func (sf *SortedFlags) VisitAll(cb func(*flag.Flag))

Jump to

Keyboard shortcuts

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