Documentation ¶
Index ¶
- Variables
- func Build(obj interface{}) (c *cli.App)
- func BuildCustom(obj interface{}, o BuildOptions) (c *cli.App)
- func ErrCommandNotImplemented() error
- func Reflected[T any]() reflect.Type
- type Actionable
- type ActionableNotImplementedError
- type BuildOptions
- type ByValueError
- type Command
- type CommandLike
- type Counter
- type HasAfter
- type HasBefore
- type HasSubcommand
- type HasVariants
- type HiddenPositionalError
- type InterfaceType
- func (ifaceType *InterfaceType) IsVariadic() bool
- func (ifaceType *InterfaceType) NewFlag(cmdMeta commandMetadata) (cli.Flag, error)
- func (ifaceType *InterfaceType) Predicate(fType reflect.Type) bool
- func (ifaceType *InterfaceType) SetValueFromContext(value reflect.Value, flagName string, context *cli.Context) (err error)
- func (ifaceType *InterfaceType) SetValueFromString(value reflect.Value, s string) (err error)
- func (ifaceType *InterfaceType) SetValueFromStrings(value reflect.Value, s []string) (err error)
- type PointerTo
- func (ptrTo *PointerTo) IsVariadic() bool
- func (ptrTo *PointerTo) NewFlag(cmdMeta commandMetadata) (cli.Flag, error)
- func (ptrTo *PointerTo) Predicate(fType reflect.Type) bool
- func (ptrTo *PointerTo) SetValueFromContext(value reflect.Value, flagName string, context *cli.Context) error
- func (ptrTo *PointerTo) SetValueFromString(value reflect.Value, s string) (err error)
- func (ptrTo *PointerTo) SetValueFromStrings(value reflect.Value, s []string) (err error)
- type PositionalAfterVariadicError
- type RunFunc
- type StandardType
- func (nt *StandardType) IsVariadic() bool
- func (nt *StandardType) NewFlag(cmdMeta commandMetadata) (cli.Flag, error)
- func (nt *StandardType) Predicate(fType reflect.Type) bool
- func (nt *StandardType) SetValueFromContext(value reflect.Value, flagName string, context *cli.Context) error
- func (nt *StandardType) SetValueFromString(val reflect.Value, s string) (err error)
- func (nt *StandardType) SetValueFromStrings(val reflect.Value, s []string) (err error)
- type TypeFunctions
- type TypeInterface
- type TypePredicate
- type WithDescription
- type WithVersion
- type WrongFirstFieldError
Constants ¶
This section is empty.
Variables ¶
View Source
var DefaultBuildOptions = BuildOptions{
EnvPrefix: "",
}
View Source
var ErrNil = errors.New("obj is n ull")
Functions ¶
func Build ¶
func Build(obj interface{}) (c *cli.App)
Build constructs a urfave/cli App from an instance of a decorated struct Since it is designed to be used 1. on initialization and; 2. with static data that is compile-time only - it does not return an error but instead panics. The idea is you will do all your setup once and as long as it doesn't change this will never break, so there is little need to pass errors back.
func BuildCustom ¶ added in v0.5.0
func BuildCustom(obj interface{}, o BuildOptions) (c *cli.App)
func ErrCommandNotImplemented ¶
func ErrCommandNotImplemented() error
Types ¶
type Actionable ¶
type Actionable interface {
Action(*cli.Context) error
}
type ActionableNotImplementedError ¶
type ActionableNotImplementedError struct {
Type string
}
func (*ActionableNotImplementedError) Error ¶
func (e *ActionableNotImplementedError) Error() string
type BuildOptions ¶ added in v0.5.0
type BuildOptions struct {
EnvPrefix string
}
type ByValueError ¶
type ByValueError struct {
Type string
}
func (*ByValueError) Error ¶
func (e *ByValueError) Error() string
type CommandLike ¶
type CommandLike interface { Root(ctx *cli.Context) interface{} Parent(ctx *cli.Context) interface{} }
type HasSubcommand ¶ added in v0.2.0
type HasSubcommand interface {
Subcommand(c *cli.App, parentCommandPath string) *cli.Command
}
type HasVariants ¶
type HasVariants interface {
Variants() []string
}
type HiddenPositionalError ¶
type HiddenPositionalError struct {
Name string
}
func (*HiddenPositionalError) Error ¶
func (e *HiddenPositionalError) Error() string
type InterfaceType ¶
type InterfaceType struct {
// contains filtered or unexported fields
}
func (*InterfaceType) IsVariadic ¶
func (ifaceType *InterfaceType) IsVariadic() bool
func (*InterfaceType) NewFlag ¶
func (ifaceType *InterfaceType) NewFlag(cmdMeta commandMetadata) (cli.Flag, error)
func (*InterfaceType) Predicate ¶
func (ifaceType *InterfaceType) Predicate(fType reflect.Type) bool
func (*InterfaceType) SetValueFromContext ¶
func (ifaceType *InterfaceType) SetValueFromContext(value reflect.Value, flagName string, context *cli.Context) (err error)
func (*InterfaceType) SetValueFromString ¶
func (ifaceType *InterfaceType) SetValueFromString(value reflect.Value, s string) (err error)
func (*InterfaceType) SetValueFromStrings ¶
func (ifaceType *InterfaceType) SetValueFromStrings(value reflect.Value, s []string) (err error)
type PointerTo ¶
type PointerTo struct {
// contains filtered or unexported fields
}
func (*PointerTo) IsVariadic ¶
func (*PointerTo) SetValueFromContext ¶
func (*PointerTo) SetValueFromString ¶
type PositionalAfterVariadicError ¶
func (*PositionalAfterVariadicError) Error ¶
func (e *PositionalAfterVariadicError) Error() string
type StandardType ¶
type StandardType struct {
// contains filtered or unexported fields
}
func NewStandardType ¶
func NewStandardType[T, Flag any]() *StandardType
func (*StandardType) IsVariadic ¶
func (nt *StandardType) IsVariadic() bool
func (*StandardType) NewFlag ¶
func (nt *StandardType) NewFlag(cmdMeta commandMetadata) (cli.Flag, error)
func (*StandardType) SetValueFromContext ¶
func (nt *StandardType) SetValueFromContext(value reflect.Value, flagName string, context *cli.Context) error
func (*StandardType) SetValueFromString ¶
func (nt *StandardType) SetValueFromString(val reflect.Value, s string) (err error)
func (*StandardType) SetValueFromStrings ¶
func (nt *StandardType) SetValueFromStrings(val reflect.Value, s []string) (err error)
type TypeFunctions ¶
type TypeFunctions interface { NewFlag(cmdMeta commandMetadata) (cli.Flag, error) SetValueFromString(val reflect.Value, s string) (err error) SetValueFromContext(value reflect.Value, flagName string, context *cli.Context) (err error) IsVariadic() bool SetValueFromStrings(val reflect.Value, s []string) (err error) }
type TypeInterface ¶
type TypeInterface interface { TypePredicate TypeFunctions }
type TypePredicate ¶
type WithDescription ¶
type WithDescription interface {
Description() string
}
type WithVersion ¶
type WithVersion interface {
Version() string
}
type WrongFirstFieldError ¶
func (*WrongFirstFieldError) Error ¶
func (e *WrongFirstFieldError) Error() string
Click to show internal directories.
Click to hide internal directories.