flags

package
v0.2.0 Latest Latest
Warning

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

Go to latest
Published: Apr 24, 2023 License: MIT Imports: 1 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Bool added in v0.0.3

type Bool struct {
	*Flag
	Default bool
	// contains filtered or unexported fields
}

func (*Bool) AddTo added in v0.0.3

func (f *Bool) AddTo(cmds ...*cobra.Command)

func (*Bool) Get added in v0.0.3

func (f *Bool) Get(cmd *cobra.Command, nonnull bool) *bool

type Flag

type Flag struct {
	Name        string
	ShortName   string
	Description string
	Required    bool
}

func (*Flag) Changed

func (f *Flag) Changed(cmd *cobra.Command) bool

type Flags

type Flags []IFlag

func (Flags) AddTo

func (fs Flags) AddTo(cmds ...*cobra.Command)

type IFlag

type IFlag interface {
	AddTo(cmds ...*cobra.Command)
}

type Int

type Int struct {
	*Flag
	Default int
	// contains filtered or unexported fields
}

func (*Int) AddTo

func (f *Int) AddTo(cmds ...*cobra.Command)

func (*Int) Get

func (f *Int) Get(cmd *cobra.Command, nonnull bool) *int

type String

type String struct {
	*Flag
	Default string
	// contains filtered or unexported fields
}

func (*String) AddTo

func (f *String) AddTo(cmds ...*cobra.Command)

func (*String) Get

func (f *String) Get(cmd *cobra.Command, nonnull bool) *string

type StringSlice

type StringSlice struct {
	*Flag
	Default []string
	// contains filtered or unexported fields
}

func (*StringSlice) AddTo

func (f *StringSlice) AddTo(cmds ...*cobra.Command)

func (*StringSlice) Get

func (f *StringSlice) Get(cmd *cobra.Command, nonnull bool) *[]string

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL
JackTT - Gopher 🇻🇳