root

package
v0.0.0-...-8dfad59 Latest Latest
Warning

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

Go to latest
Published: Dec 20, 2024 License: MIT Imports: 13 Imported by: 6

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func AddCommand

func AddCommand(c *cobra.Command, fc any)

func CreateCmd

func CreateCmd(parent *cobra.Command, use, short string, obj interface {
	Run(*cobra.Command, []string) error
}) *cobra.Command

func InitFlags

func InitFlags(f any, pf, persistent *pflag.FlagSet) error

func NewVersionValue

func NewVersionValue() *versionValue

func Run

func Run()

func RunCmd

func RunCmd(parent *cobra.Command, use, short string, obj interface {
	Run(*cobra.Command, []string) error
})

func SplitSeps

func SplitSeps(s string, seps string) []string

Types

type CmdLongHelper

type CmdLongHelper interface {
	LongHelp() string
}

type DefaultPlagValuesAware

type DefaultPlagValuesAware interface {
	DefaultPlagValues(name string) (any, bool)
}

type Enum

type Enum struct {
	Allows    []string
	Value     *string
	ValueInt  *int
	ValueType EnumType
}

func NewEnum

func NewEnum(allows []string, val *string, defaultVal string) *Enum

func NewEnumInt

func NewEnumInt(allows []string, val *int, defaultVal int) *Enum

func (*Enum) Set

func (e *Enum) Set(v string) error

Set must have pointer receiver so it doesn't change the value of a copy

func (Enum) String

func (e Enum) String() string

String is used both by fmt.Print and by Cobra in help text

func (*Enum) Type

func (e *Enum) Type() string

Type is only used in help text

type EnumType

type EnumType int
const (
	EnumString EnumType = iota
	EnumInt
)

Jump to

Keyboard shortcuts

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