cmdflag

package
v1.5.7 Latest Latest
Warning

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

Go to latest
Published: Feb 10, 2026 License: BSD-3-Clause, MIT Imports: 7 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Bool

type Bool struct {
	Name        string
	Label       string
	Description string
	Value       *bool

	Required bool
	// contains filtered or unexported fields
}

func (*Bool) GetName

func (f *Bool) GetName() string

func (*Bool) GetValue

func (f *Bool) GetValue() interface{}

func (*Bool) IsRequired

func (f *Bool) IsRequired() bool

func (*Bool) Prompt

func (f *Bool) Prompt() prompt.PromptInput

func (*Bool) Register

func (f *Bool) Register(s *pflag.FlagSet)

func (*Bool) UpdateOptions

func (f *Bool) UpdateOptions(options interface{})

type FlagSchema

type FlagSchema interface {
	Register(f *pflag.FlagSet)
	UpdateOptions(options interface{})
	GetValue() interface{}
	GetName() string
	Prompt() prompt.PromptInput
	IsRequired() bool
}

type Flags

type Flags struct {
	FlagSet           *pflag.FlagSet
	PromptDescription string
	// contains filtered or unexported fields
}

func (*Flags) AddFlagOption

func (f *Flags) AddFlagOption(flagName string, option []string)

func (*Flags) AssignValues

func (f *Flags) AssignValues(params interface{}) error

func (*Flags) GetInputs

func (f *Flags) GetInputs() []prompt.PromptInput

func (*Flags) PreRun

func (f *Flags) PreRun(cmd *cobra.Command, args []string)

func (*Flags) Register

func (f *Flags) Register(s *FlagsSchema)

type FlagsSchema

type FlagsSchema []FlagSchema

type Int64

type Int64 struct {
	Name        string
	Description string
	Value       *int64

	Required bool
	Label    string
	// contains filtered or unexported fields
}

func (*Int64) GetName

func (f *Int64) GetName() string

func (*Int64) GetValue

func (f *Int64) GetValue() interface{}

func (*Int64) IsRequired

func (f *Int64) IsRequired() bool

func (*Int64) Prompt

func (f *Int64) Prompt() prompt.PromptInput

func (*Int64) Register

func (f *Int64) Register(s *pflag.FlagSet)

func (*Int64) UpdateOptions

func (f *Int64) UpdateOptions(options interface{})

type String

type String struct {
	Name           string
	CustomFlagName string
	Label          string
	Description    string

	Value    *string
	Options  []string
	Required bool
	// contains filtered or unexported fields
}

func (*String) GetName

func (f *String) GetName() string

func (*String) GetValue

func (f *String) GetValue() interface{}

func (*String) IsRequired

func (f *String) IsRequired() bool

func (*String) Prompt

func (f *String) Prompt() prompt.PromptInput

func (*String) Register

func (f *String) Register(s *pflag.FlagSet)

func (*String) UpdateOptions

func (f *String) UpdateOptions(options interface{})

type StringSlice

type StringSlice struct {
	Name        string
	Label       string
	Description string

	Value    *[]string
	Required bool
	// contains filtered or unexported fields
}

func (*StringSlice) GetName

func (f *StringSlice) GetName() string

func (*StringSlice) GetValue

func (f *StringSlice) GetValue() interface{}

func (*StringSlice) IsRequired

func (f *StringSlice) IsRequired() bool

func (*StringSlice) Prompt

func (f *StringSlice) Prompt() prompt.PromptInput

func (*StringSlice) Register

func (f *StringSlice) Register(s *pflag.FlagSet)

func (*StringSlice) UpdateOptions

func (f *StringSlice) UpdateOptions(options interface{})

Jump to

Keyboard shortcuts

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