cmdutils

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: 14 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func JoinAttrs

func JoinAttrs(attrs []string) string

Types

type CobraCommandVlidation

type CobraCommandVlidation[T any] struct {
	Validator      flags.BatchValidator
	NamedTypesFlag *flags.CommandFlag[[]string]
	OutputTypeFlag *flags.CommandFlag[string]
	OutputOptions  OutputOptions[T]
	// contains filtered or unexported fields
}

func (*CobraCommandVlidation[T]) CommandValidation

func (v *CobraCommandVlidation[T]) CommandValidation(cmd *cobra.Command) error

func (*CobraCommandVlidation[T]) GetNamedTypes

func (v *CobraCommandVlidation[T]) GetNamedTypes() []codescout.NamedType

type OutputOptions

type OutputOptions[T any] struct {
	Options map[string]func(T) string
}

func (OutputOptions[T]) ToOptionString

func (o OutputOptions[T]) ToOptionString() string

type ScoutContainer

type ScoutContainer[T any, C any] struct {
	ScoutFirst     func(path string, config C) (*T, error)
	ScoutAll       func(path string, config C) ([]*T, error)
	Path           string
	Options        OutputOptions[*T]
	BoxWidth       int
	SeparatorColor *color.Color
	Config         C
	DefType        string
	OutputType     string
}

func NewScoutContainer

func NewScoutContainer[T any, C any](
	scoutFirst func(path string, config C) (*T, error),
	scoutAll func(path string, config C) ([]*T, error),
	path string,
	options OutputOptions[*T],
	config C,
	defType string,
	outputType string,
) ScoutContainer[T, C]

func (ScoutContainer[T, C]) Display

func (c ScoutContainer[T, C]) Display(verbose bool) error

Jump to

Keyboard shortcuts

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