Documentation
¶
Index ¶
- func DefaultCompletions(cmdCtx wargcore.Context) (*completion.Candidates, error)
- func DoNothing(_ wargcore.Context) error
- func New(helpShort string, action wargcore.Action, opts ...CommandOpt) wargcore.Command
- type CommandOpt
- func Completions(CompletionsFunc wargcore.CompletionsFunc) CommandOpt
- func Flag(name string, value wargcore.Flag) CommandOpt
- func FlagMap(flagMap wargcore.FlagMap) CommandOpt
- func Footer(footer string) CommandOpt
- func HelpLong(helpLong string) CommandOpt
- func NewFlag(name string, helpShort string, empty value.EmptyConstructor, ...) CommandOpt
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func DefaultCompletions ¶ added in v0.0.34
func DefaultCompletions(cmdCtx wargcore.Context) (*completion.Candidates, error)
Types ¶
type CommandOpt ¶
A CommandOpt customizes a Command
func Completions ¶ added in v0.0.34
func Completions(CompletionsFunc wargcore.CompletionsFunc) CommandOpt
func Flag ¶
func Flag(name string, value wargcore.Flag) CommandOpt
Flag adds an existing flag to a Command. It panics if a flag with the same name exists
func FlagMap ¶ added in v0.0.28
func FlagMap(flagMap wargcore.FlagMap) CommandOpt
FlagMap adds existing flags to a Command. It panics if a flag with the same name exists
func Footer ¶
func Footer(footer string) CommandOpt
Footer adds an Help string to the command - useful from a help function
func HelpLong ¶
func HelpLong(helpLong string) CommandOpt
HelpLong adds an Help string to the command - useful from a help function
func NewFlag ¶ added in v0.0.28
func NewFlag(name string, helpShort string, empty value.EmptyConstructor, opts ...flag.FlagOpt) CommandOpt
NewFlag builds a flag and adds it to a Command. It panics if a flag with the same name exists
Click to show internal directories.
Click to hide internal directories.