arguments

package
v0.1.50 Latest Latest
Warning

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

Go to latest
Published: May 20, 2021 License: Apache-2.0 Imports: 17 Imported by: 4

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func AddAutoscalingFlags added in v0.1.47

func AddAutoscalingFlags(fs *pflag.FlagSet, value *cluster.Autoscaling)

AddAutoscalingFlags adds the --enable-autoscaling --min-replicas and --max-replicas flags

func AddBodyFlag

func AddBodyFlag(fs *pflag.FlagSet, value *string)

AddBodyFlag adds the '--body' flag to the given set of command line flags.

func AddCCSFlags added in v0.1.45

func AddCCSFlags(fs *pflag.FlagSet, value *cluster.CCS)

AddCCSFlags adds all the flags needed for creating a cluster.

func AddCCSFlagsWithoutAccountID added in v0.1.45

func AddCCSFlagsWithoutAccountID(fs *pflag.FlagSet, value *cluster.CCS)

AddCCSFlagsWithoutAccountID is sufficient for list regions command.

func AddDebugFlag

func AddDebugFlag(fs *pflag.FlagSet)

AddDebugFlag adds the '--debug' flag to the given set of command line flags.

func AddHeaderFlag

func AddHeaderFlag(fs *pflag.FlagSet, values *[]string)

AddHeaderFlag adds the '--header' flag to the given set of command line flags.

func AddInteractiveFlag added in v0.1.46

func AddInteractiveFlag(flags *pflag.FlagSet, value *bool)

AddFlag adds the interactive flag to the given set of command line flags.

func AddParameterFlag

func AddParameterFlag(fs *pflag.FlagSet, values *[]string)

AddParameterFlag adds the '--parameter' flag to the given set of command line flags.

func AddProviderFlag added in v0.1.45

func AddProviderFlag(fs *pflag.FlagSet, value *string)

func ApplyBodyFlag

func ApplyBodyFlag(request *sdk.Request, value string) error

ApplyBodyFlag applies the value of the '--body' command line flag to the given request.

func ApplyHeaderFlag

func ApplyHeaderFlag(request interface{}, values []string)

ApplyHeaderFlag applies the value of the '--header' command line flag to the given request.

func ApplyParameterFlag

func ApplyParameterFlag(request interface{}, values []string)

ApplyParameterFlag applies the value of the '--parameter' command line flag to the given request.

func ApplyPathArg

func ApplyPathArg(request *sdk.Request, value string) error

ApplyPathArg applies the value of the path given in the command line to the given request.

func CheckAutoscalingFlags added in v0.1.48

func CheckAutoscalingFlags(autoscaling cluster.Autoscaling, computeNodes int) error

CheckAutoscalingFlags errors if --min-replicas or --max-replicas were used without --enable-autoscaling (and vice-versa with --compute-nodes) It also errors if --min-replicas or --max-replicas were not supplied when --enable-autoscaling is used

func CheckIgnoredCCSFlags added in v0.1.45

func CheckIgnoredCCSFlags(ccs cluster.CCS) error

CheckIgnoredCCSFlags errors if --aws-... were used without --ccs.

func CheckOneOf added in v0.1.46

func CheckOneOf(fs *pflag.FlagSet, flagName string, options []Option) error

CheckOneOf returns error if flag has been set and is not one of given options. It's appropriate for both optional flags (no error not given) and required flags (Cobra validated they're given before command .Run).

func ParseNameValuePair added in v0.1.50

func ParseNameValuePair(text string) (name, value string)

ParseNameValuePair parses a name value pair.

func PromptBool added in v0.1.46

func PromptBool(fs *pflag.FlagSet, flagName string) error

PromptBool sets a bool flag value interactively, unless already set. Does nothing in non-interactive mode.

func PromptFilePath added in v0.1.46

func PromptFilePath(fs *pflag.FlagSet, flagName string) error

PromptFilePath sets a FilePath flag value interactively, unless already set. Does nothing in non-interactive mode.

func PromptIPNet added in v0.1.46

func PromptIPNet(fs *pflag.FlagSet, flagName string) error

PromptIPNet sets an optional IPNet flag value interactively, unless already set. Does nothing in non-interactive mode.

func PromptInt added in v0.1.46

func PromptInt(fs *pflag.FlagSet, flagName string, validate func() error) error

PromptInt sets an integer flag value interactively, unless already set. validation func is optional, and runs after the flag is already set. Does nothing in non-interactive mode. TODO: always validate, prompt if bad.

func PromptOneOf added in v0.1.46

func PromptOneOf(fs *pflag.FlagSet, flagName string, options []Option) error

PromptOneOf sets a string flag value interactively, from a set of valid options, unless already set.

func PromptOrCheckOneOf added in v0.1.46

func PromptOrCheckOneOf(fs *pflag.FlagSet, flagName string, options []Option) error

PromptOrCheckOneOf uses a set of valid options for interactive prompt and/or validation. When flag is already set, validates it and doesn't prompt. TODO: prompt if bad. When not interactive, allows an optional flag to remain omitted.

func PromptPassword added in v0.1.46

func PromptPassword(fs *pflag.FlagSet, flagName string) error

PromptPassword sets a sensitive string flag value interactively, unless already set. Does nothing in non-interactive mode.

func PromptString added in v0.1.46

func PromptString(fs *pflag.FlagSet, flagName string) error

PromptString sets a string flag value interactively, unless already set. Does nothing in non-interactive mode.

func SetQuestion added in v0.1.46

func SetQuestion(fs *pflag.FlagSet, flagName, question string)

SetQuestion sets a friendlier text to use when prompting instead of flag name.

func Split added in v0.1.46

func Split(r rune) bool

Types

type CobraCompletionFunc added in v0.1.46

type CobraCompletionFunc func(cmd *cobra.Command, args []string, toComplete string) ([]string, cobra.ShellCompDirective)

CobraCompletionFunc is the signature cobra.RegisterFlagCompletionFunc() wants.

func MakeCompleteFunc added in v0.1.46

func MakeCompleteFunc(optionsFunc OptionsFunc) CobraCompletionFunc

type FilePath added in v0.1.46

type FilePath string

func (*FilePath) Set added in v0.1.46

func (f *FilePath) Set(v string) error

func (*FilePath) String added in v0.1.46

func (f *FilePath) String() string

func (*FilePath) Type added in v0.1.46

func (f *FilePath) Type() string

type Option added in v0.1.46

type Option struct {
	Value string
	// Optional extra text to show (not always supported).
	Description string
}

Option represents a value that can be used in interactive Select menu, or shell completion.

type OptionsFunc added in v0.1.46

type OptionsFunc func(connection *sdk.Connection) ([]Option, error)

OptionsFunc is a signature for functions generating arrays of values. They will be used both for interactive mode and flag completions.

Jump to

Keyboard shortcuts

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