flags

package
v0.34.2 Latest Latest
Warning

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

Go to latest
Published: Oct 19, 2021 License: Apache-2.0 Imports: 12 Imported by: 0

Documentation

Overview

Package flags is a helper package for processing and interactive command line flags

Index

Constants

This section is empty.

Variables

Functions

func EnableOutputFlagCompletion

func EnableOutputFlagCompletion(cmd *cobra.Command)

EnableOutputFlagCompletion enables autocompletion for output flag

func EnableStaticFlagCompletion

func EnableStaticFlagCompletion(cmd *cobra.Command, flagName string, validValues []string)

EnableStaticFlagCompletion enables autocompletion for flags with predefined valid values

func FlagDescription added in v0.34.2

func FlagDescription(localizer localize.Localizer, messageID string, validOptions ...string) string

FlagDescription creates a flag description and adds a list of valid options (if any)

func IsValidInput

func IsValidInput(input string, validValues ...string) bool

IsValidInput checks if the input value is in the range of valid values

func RegisterServiceAccountCompletionFunc added in v0.34.2

func RegisterServiceAccountCompletionFunc(cmd *cobra.Command, flagName string, connFunc factory.ConnectionFunc) error

RegisterNameFlagCompletionFunc adds the user list to flag dynamic completion

func RegisterUserCompletionFunc added in v0.34.2

func RegisterUserCompletionFunc(cmd *cobra.Command, flagName string, connFunc factory.ConnectionFunc) error

RegisterUserCompletionFunc adds the user list to flag dynamic completion

Types

type FlagSet added in v0.34.2

type FlagSet struct {
	// contains filtered or unexported fields
}

func NewFlagSet added in v0.34.2

func NewFlagSet(cmd *cobra.Command, localizer localize.Localizer) *FlagSet

func (*FlagSet) AddOutput added in v0.34.2

func (fs *FlagSet) AddOutput(output *string)

AddOutput adds an output flag to the command

func (*FlagSet) AddYes added in v0.34.2

func (fs *FlagSet) AddYes(yes *bool)

AddYes adds a "yes" flag to the command

Jump to

Keyboard shortcuts

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