klocust

package
v0.0.1 Latest Latest
Warning

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

Go to latest
Published: May 11, 2021 License: Apache-2.0 Imports: 16 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func AddFlags

func AddFlags(cmd *cobra.Command)

AddFlags adds to the command the common flags that are annotated with the command name.

func NewApplyCmd

func NewApplyCmd() *cobra.Command

func NewCompletionCmd

func NewCompletionCmd() *cobra.Command

NewCompletionCmd returns the cobra command that outputs shell completion code

func NewDeleteCmd

func NewDeleteCmd() *cobra.Command

func NewInitCmd

func NewInitCmd() *cobra.Command

func NewListCmd

func NewListCmd() *cobra.Command

func NewRootCommand

func NewRootCommand(out, stderr io.Writer) *cobra.Command

Get root command

func NewVersionCmd

func NewVersionCmd() *cobra.Command

Get klocust version

func SetUpLogs

func SetUpLogs(stdErr io.Writer, level string) error

SetUpLogs set logrus log format

Types

type Builder

type Builder interface {
	WithDescription(description string) Builder
	WithLongDescription(long string) Builder
	WithExample(comment, command string) Builder
	WithFlags(flags []*Flag) Builder
	SetAliases(alias []string) Builder
	WithCommonFlags() Builder
	Hidden() Builder
	ExactArgs(argCount int, action func(context.Context, io.Writer, *cobra.Command, []string) error) *cobra.Command
	NoArgs(action func(context.Context, io.Writer) error) *cobra.Command
}

Builder is used to build cobra commands.

func NewCmd

func NewCmd(use string) Builder

NewCmd creates a new command builder.

type CommonFlag

type CommonFlag struct {
	Namespace string
}

type Flag

type Flag struct {
	Name               string
	Shorthand          string
	Usage              string
	Value              interface{}
	DefValue           interface{}
	DefValuePerCommand map[string]interface{}
	FlagAddMethod      string
	DefinedOn          []string
	Hidden             bool
	// contains filtered or unexported fields
}

Jump to

Keyboard shortcuts

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