Documentation ¶
Overview ¶
Package flagutil is a helper package for processing and interactive command line flags
Index ¶
- Variables
- func EnableOutputFlagCompletion(cmd *cobra.Command)
- func EnableStaticFlagCompletion(cmd *cobra.Command, flagName string, validValues []string)
- func FlagDescription(localizer localize.Localizer, messageID string, validOptions ...string) string
- func IsValidInput(input string, validValues ...string) bool
- func RegisterGroupCompletionFunc(cmd *cobra.Command, f *factory.Factory) error
- func RegisterServiceAccountCompletionFunc(cmd *cobra.Command, f *factory.Factory) error
- func RegisterTopicCompletionFunc(cmd *cobra.Command, f *factory.Factory) error
- func RegisterUserCompletionFunc(cmd *cobra.Command, flagName string, f *factory.Factory) error
- type FlagOptions
- type FlagSet
Constants ¶
This section is empty.
Variables ¶
var ( ValidOutputFormats = []string{dump.JSONFormat, dump.YAMLFormat, dump.YMLFormat} CredentialsOutputFormats = []string{credentials.EnvFormat, credentials.JSONFormat, credentials.PropertiesFormat} )
Functions ¶
func EnableOutputFlagCompletion ¶
EnableOutputFlagCompletion enables autocompletion for output flag
func EnableStaticFlagCompletion ¶
EnableStaticFlagCompletion enables autocompletion for flags with predefined valid values
func FlagDescription ¶
FlagDescription creates a flag description and adds a list of valid options (if any)
func IsValidInput ¶
IsValidInput checks if the input value is in the range of valid values
func RegisterGroupCompletionFunc ¶ added in v0.36.3
RegisterGroupCompletionFunc enables dynamic autocompletion for group flag
func RegisterServiceAccountCompletionFunc ¶
RegisterServiceAccountCompletionFunc adds the service account list to flag dynamic completion
func RegisterTopicCompletionFunc ¶ added in v0.36.3
RegisterTopicCompletionFunc enables dynamic autocompletion for topic flag
Types ¶
type FlagOptions ¶
type FlagOptions struct {
Required func() error
}
FlagOptions defines additional flag options
func WithFlagOptions ¶
func WithFlagOptions(cmd *cobra.Command, flagName string) *FlagOptions
WithFlagOptions returns additional functions to custom the default flag settings
type FlagSet ¶
func NewFlagSet ¶
NewFlagSet returns a new flag set with some common flags
func (*FlagSet) AddBypassTermsCheck ¶ added in v0.36.2
AddBypassTermsCheck adds a flag to allow bypassing of the terms check before creating an instance