util

package
v0.16.0 Latest Latest
Warning

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

Go to latest
Published: Jun 8, 2023 License: MIT Imports: 10 Imported by: 0

Documentation

Index

Constants

View Source
const (
	StrTrue  = "true"
	StrFalse = "false"
)
View Source
const (
	HelpTemplate = "bns_annotation_help_template"
)

Variables

View Source
var (
	ErrInvalidValue = errors.New("invalid value")
)

Functions

func AddGroupedCommands added in v0.9.1

func AddGroupedCommands(mainCommand *cobra.Command, group cobra.Group, cmds []*cobra.Command)

func AllComandsHelpFlag added in v0.10.0

func AllComandsHelpFlag(command *cobra.Command)

func AppendFlagHelp added in v0.14.1

func AppendFlagHelp(flag *pflag.Flag, helpTemplate string) *pflag.Flag

func GetAvailableEphemeralPort added in v0.2.0

func GetAvailableEphemeralPort(iface string) (int, error)

func GetHelp added in v0.14.1

func GetHelp(flag *pflag.Flag) string

func GetWorkspaceDir added in v0.2.0

func GetWorkspaceDir() (string, error)

func GetWorkspaceDirAndShort added in v0.10.0

func GetWorkspaceDirAndShort() (string, string, error)

func HasHelp added in v0.14.1

func HasHelp(flag *pflag.Flag) bool

func IsHidden added in v0.14.1

func IsHidden(flag *pflag.Flag) bool

func MakeSpinner added in v0.2.0

func MakeSpinner(suffix string) *spinner.Spinner

func MarkFlag added in v0.14.1

func MarkFlag(flag *pflag.Flag, flagTypes ...BoolFlagType) *pflag.Flag

func MarkFlagRequiredWithHelp added in v0.14.1

func MarkFlagRequiredWithHelp(flag *pflag.Flag, helpTemplate string) *pflag.Flag

func PersistentPreRunChain added in v0.10.0

func PersistentPreRunChain(command *cobra.Command, args []string) error

Types

type BoolFlagType added in v0.14.1

type BoolFlagType string
const (
	FlagHidden   BoolFlagType = "bns_annotation_hidden"
	FlagRequired BoolFlagType = cobra.BashCompOneRequiredFlag
	FlagDirname  BoolFlagType = cobra.BashCompSubdirsInDir
)

Jump to

Keyboard shortcuts

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