flags

package
v1.0.1 Latest Latest
Warning

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

Go to latest
Published: May 6, 2025 License: MIT Imports: 5 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func BoolVarP

func BoolVarP(cmd *cobra.Command, flag *CommandFlag[bool], s string, v bool, u string)

func StringBoolToPointer

func StringBoolToPointer(strBool string) *bool

func StringSliceVarP

func StringSliceVarP(cmd *cobra.Command, flag *CommandFlag[[]string], s string, v []string, u string)

func StringVarP

func StringVarP(cmd *cobra.Command, flag *CommandFlag[string], s string, v string, u string)

Types

type BatchValidator

type BatchValidator struct {
	EmptyValidators      []FlagValidator
	StringBoolValidators []*CommandFlag[string]
}

func (BatchValidator) Validate

func (v BatchValidator) Validate(cmd *cobra.Command) error

type CommandFlag

type CommandFlag[T FlagVariable] struct {
	Name     string
	Variable T
}

type FlagValidator

type FlagValidator interface {
	// contains filtered or unexported methods
}

type FlagVariable

type FlagVariable interface {
	bool | string | []string
}

Jump to

Keyboard shortcuts

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