Documentation
¶
Index ¶
- func ConvertApp(jfrogApp App) (*cli.App, error)
- func ConvertAppCommands(jfrogApp App, commandPrefix ...string) (cmds []cli.Command, err error)
- type ActionFunc
- type App
- type Argument
- type BaseFlag
- type BoolFlag
- type BoolFlagOption
- type Command
- type Context
- func (c *Context) AddBoolFlag(key string, value bool)
- func (c *Context) AddStringFlag(key, value string)
- func (c *Context) GetArgumentAt(index int) string
- func (c *Context) GetBoolFlagValue(flagName string) bool
- func (c *Context) GetBoolTFlagValue(flagName string) bool
- func (c *Context) GetDefaultIntFlagValueIfNotSet(flagName string, defaultValue int) (value int, err error)
- func (c *Context) GetIntFlagValue(flagName string) (value int, err error)
- func (c *Context) GetNumberOfArgs() int
- func (c *Context) GetParent() *Context
- func (c *Context) GetStringFlagValue(flagName string) string
- func (c *Context) GetStringsArrFlagValue(flagName string) (resultArray []string)
- func (c *Context) IsFlagSet(flagName string) bool
- func (c *Context) SetStringFlagValue(flagName string, value string)
- func (c *Context) WithDefaultIntFlagValue(flagName string, defValue int) (value int, err error)
- type EnvVar
- type Flag
- type Namespace
- type PluginSignature
- type StringFlag
- type StringFlagOption
- func SetHiddenStrFlag() StringFlagOption
- func SetMandatory() StringFlagOption
- func SetMandatoryFalse() StringFlagOption
- func SetMandatoryTrue() StringFlagOption
- func WithHelpValue(helpValue string) StringFlagOption
- func WithIntDefaultValue(defaultValue int) StringFlagOption
- func WithStrDefaultValue(defaultValue string) StringFlagOption
- type UsageOptions
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
Types ¶
type ActionFunc ¶
type Argument ¶
type Argument struct {
Name string
// Is this argument optional? If so, the 'Optional' field should be set to true.
// This field is used for creating help usages, for instance if argument is:
// Argument {
// Name: "optional-arg",
// Optional: true,
// }
// The help usage that will be created will be:
//
// Usage:
// 1) cmd-name [cmd options] [optional-arg]
//
// Else, if the argument is mandatory ( Argument { Name: "mandatory-arg" } ), the help usage will be:
//
// Usage:
// 1) cmd-name [cmd options] <mandatory-arg>
Optional bool
// Is this argument optional and can be replaced with a flag?
// If so, the 'Optional' field should be set to true and the 'ReplaceWithFlag' field should be set to the flag name.
// This field is used for creating help usages, for instance if argument is:
// Argument {
// Name: "optional-arg",
// Optional: true,
// ReplaceWithFlag: "flag-replacement",
// }
// The help usage that will be created will be:
//
// Usage:
// 1) cmd-name [cmd options] [optional-arg]
// 2) cmd-name [cmd options] --flag-replacement=value
ReplaceWithFlag string
Description string
}
type BaseFlag ¶ added in v2.47.10
func (BaseFlag) GetDescription ¶ added in v2.47.10
func (BaseFlag) IsMandatory ¶ added in v2.47.10
type BoolFlag ¶
func NewBoolFlag ¶ added in v2.47.10
func NewBoolFlag(name, description string, options ...BoolFlagOption) BoolFlag
func (BoolFlag) GetDefault ¶
type BoolFlagOption ¶ added in v2.47.10
type BoolFlagOption func(f *BoolFlag)
func SetHiddenBoolFlag ¶ added in v2.47.10
func SetHiddenBoolFlag() BoolFlagOption
func WithBoolDefaultValue ¶ added in v2.47.10
func WithBoolDefaultValue(defaultValue bool) BoolFlagOption
func WithBoolDefaultValueFalse ¶ added in v2.58.1
func WithBoolDefaultValueFalse() BoolFlagOption
func WithBoolDefaultValueTrue ¶ added in v2.58.3
func WithBoolDefaultValueTrue() BoolFlagOption
type Context ¶
type Context struct {
Arguments []string
CommandName string
PrintCommandHelp func(commandName string) error
ParentContext *Context
// contains filtered or unexported fields
}
func ConvertContext ¶ added in v2.47.11
func (*Context) AddBoolFlag ¶ added in v2.58.3
func (*Context) AddStringFlag ¶ added in v2.57.2
func (*Context) GetArgumentAt ¶ added in v2.58.3
func (*Context) GetBoolFlagValue ¶
func (*Context) GetBoolTFlagValue ¶ added in v2.58.3
func (*Context) GetDefaultIntFlagValueIfNotSet ¶ added in v2.58.3
func (*Context) GetIntFlagValue ¶ added in v2.47.10
func (*Context) GetNumberOfArgs ¶ added in v2.58.3
func (*Context) GetStringFlagValue ¶
func (*Context) GetStringsArrFlagValue ¶ added in v2.58.3
func (*Context) SetStringFlagValue ¶ added in v2.58.3
type PluginSignature ¶
type StringFlag ¶
type StringFlag struct {
BaseFlag
Mandatory bool
// A flag with default value cannot be mandatory.
DefaultValue string
// Optional. If provided, this field will be used for help usage. --<Name>=<HelpValue> else: --<Name>=<value>
HelpValue string
}
func NewStringFlag ¶ added in v2.47.10
func NewStringFlag(name, description string, options ...StringFlagOption) StringFlag
func (StringFlag) GetDefault ¶
func (f StringFlag) GetDefault() string
func (StringFlag) IsMandatory ¶ added in v2.47.10
func (f StringFlag) IsMandatory() bool
type StringFlagOption ¶ added in v2.47.10
type StringFlagOption func(f *StringFlag)
func SetHiddenStrFlag ¶ added in v2.47.10
func SetHiddenStrFlag() StringFlagOption
func SetMandatory ¶ added in v2.47.10
func SetMandatory() StringFlagOption
func SetMandatoryFalse ¶ added in v2.58.1
func SetMandatoryFalse() StringFlagOption
func SetMandatoryTrue ¶ added in v2.58.3
func SetMandatoryTrue() StringFlagOption
func WithHelpValue ¶ added in v2.47.10
func WithHelpValue(helpValue string) StringFlagOption
func WithIntDefaultValue ¶ added in v2.47.10
func WithIntDefaultValue(defaultValue int) StringFlagOption
func WithStrDefaultValue ¶ added in v2.47.10
func WithStrDefaultValue(defaultValue string) StringFlagOption
type UsageOptions ¶ added in v2.47.10
type UsageOptions struct {
// Special cases, each of these will be created as command usage option and the value appended as suffix for the command name.
Usage []string
// If true then the given usages will replace the auto generated usage. Otherwise the given usages will be appended to the auto generated usage.
ReplaceAutoGeneratedUsage bool
}
Click to show internal directories.
Click to hide internal directories.