cli

package
v0.6.1 Latest Latest
Warning

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

Go to latest
Published: May 10, 2021 License: MIT Imports: 43 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func BuildOauthTokenParams

func BuildOauthTokenParams(clientID, clientSecret, audience string) url.Values

func BuildOauthTokenURL

func BuildOauthTokenURL(domain string) string

func Execute

func Execute()

Execute is the primary entrypoint of the CLI app.

func RunLogin

func RunLogin(ctx context.Context, cli *cli, expired bool) error

RunLogin runs the login flow guiding the user through the process by showing the login instructions, opening the browser. Use `expired` to run the login from other commands setup: this will only affect the messages.

func WrappedInheritedFlagUsages

func WrappedInheritedFlagUsages(cmd *cobra.Command) string

WrappedInheritedFlagUsages returns a string containing the usage information for all flags which were inherited from parent commands, wrapped to the terminal's width.

func WrappedLocalFlagUsages

func WrappedLocalFlagUsages(cmd *cobra.Command) string

WrappedLocalFlagUsages returns a string containing the usage information for all flags specifically set in the current command, wrapped to the terminal's width.

func WrappedNonRequestParamsFlagUsages

func WrappedNonRequestParamsFlagUsages(cmd *cobra.Command) string

WrappedNonRequestParamsFlagUsages returns a string containing the usage information for all non-request parameters flags. The string is wrapped to the terminal's width.

func WrappedRequestParamsFlagUsages

func WrappedRequestParamsFlagUsages(cmd *cobra.Command) string

WrappedRequestParamsFlagUsages returns a string containing the usage information for all request parameters flags, i.e. flags used in operation commands to set values for request parameters. The string is wrapped to the terminal's width.

Types

type Argument added in v0.3.0

type Argument struct {
	Name string
	Help string
}

func (*Argument) Ask added in v0.3.0

func (a *Argument) Ask(cmd *cobra.Command, value interface{}) error

func (Argument) GetHelp added in v0.3.0

func (a Argument) GetHelp() string

func (Argument) GetIsRequired added in v0.3.0

func (a Argument) GetIsRequired() bool

func (Argument) GetLabel added in v0.3.0

func (a Argument) GetLabel() string

func (Argument) GetName added in v0.3.0

func (a Argument) GetName() string

func (*Argument) Pick added in v0.3.2

func (a *Argument) Pick(cmd *cobra.Command, result *string, fn pickerOptionsFunc) error

type Flag added in v0.2.3

type Flag struct {
	Name         string
	LongForm     string
	ShortForm    string
	Help         string
	IsRequired   bool
	AlwaysPrompt bool
}

func (*Flag) Ask added in v0.2.3

func (f *Flag) Ask(cmd *cobra.Command, value interface{}, defaultValue *string) error

func (*Flag) AskBool added in v0.4.1

func (f *Flag) AskBool(cmd *cobra.Command, value *bool, defaultValue *bool) error

func (*Flag) AskBoolU added in v0.4.1

func (f *Flag) AskBoolU(cmd *cobra.Command, value *bool, defaultValue *bool) error

func (*Flag) AskMany added in v0.3.1

func (f *Flag) AskMany(cmd *cobra.Command, value interface{}, defaultValue *string) error

func (*Flag) AskManyU added in v0.3.1

func (f *Flag) AskManyU(cmd *cobra.Command, value interface{}, defaultValue *string) error

func (*Flag) AskU added in v0.2.3

func (f *Flag) AskU(cmd *cobra.Command, value interface{}, defaultValue *string) error

func (*Flag) EditorPrompt added in v0.4.0

func (f *Flag) EditorPrompt(cmd *cobra.Command, value *string, initialValue, filename string, infoFn func()) error

func (*Flag) EditorPromptU added in v0.4.0

func (f *Flag) EditorPromptU(cmd *cobra.Command, value *string, initialValue, filename string, infoFn func()) error

func (*Flag) EditorPromptW added in v0.6.0

func (f *Flag) EditorPromptW(cmd *cobra.Command, value *string, initialValue, filename string, infoFn func(), tempFileCreatedFn func(string)) error

func (Flag) GetHelp added in v0.3.0

func (f Flag) GetHelp() string

func (Flag) GetIsRequired added in v0.3.0

func (f Flag) GetIsRequired() bool

func (Flag) GetLabel added in v0.3.0

func (f Flag) GetLabel() string

func (Flag) GetName added in v0.3.0

func (f Flag) GetName() string

func (*Flag) IsSet added in v0.6.0

func (f *Flag) IsSet(cmd *cobra.Command) bool

func (*Flag) RegisterBool added in v0.3.0

func (f *Flag) RegisterBool(cmd *cobra.Command, value *bool, defaultValue bool)

func (*Flag) RegisterBoolU added in v0.3.0

func (f *Flag) RegisterBoolU(cmd *cobra.Command, value *bool, defaultValue bool)

func (*Flag) RegisterInt added in v0.3.0

func (f *Flag) RegisterInt(cmd *cobra.Command, value *int, defaultValue int)

func (*Flag) RegisterIntU added in v0.3.0

func (f *Flag) RegisterIntU(cmd *cobra.Command, value *int, defaultValue int)

func (*Flag) RegisterString added in v0.2.3

func (f *Flag) RegisterString(cmd *cobra.Command, value *string, defaultValue string)

func (*Flag) RegisterStringSlice added in v0.2.5

func (f *Flag) RegisterStringSlice(cmd *cobra.Command, value *[]string, defaultValue []string)

func (*Flag) RegisterStringSliceU added in v0.2.5

func (f *Flag) RegisterStringSliceU(cmd *cobra.Command, value *[]string, defaultValue []string)

func (*Flag) RegisterStringU added in v0.2.3

func (f *Flag) RegisterStringU(cmd *cobra.Command, value *string, defaultValue string)

func (*Flag) Select added in v0.2.5

func (f *Flag) Select(cmd *cobra.Command, value interface{}, options []string, defaultValue *string) error

func (*Flag) SelectU added in v0.2.5

func (f *Flag) SelectU(cmd *cobra.Command, value interface{}, options []string, defaultValue *string) error

Jump to

Keyboard shortcuts

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