Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
View Source
var Registry = []CommandDef{}
Registry holds the root commands of the application
Functions ¶
Types ¶
type CommandDef ¶
type CommandDef struct {
Use string
Short string
Long string
Flags []FlagDef
Handler HandlerFunc
SubCommands []CommandDef
}
CommandDef defines a single command in the application
type FlagDef ¶
type FlagDef struct {
Name string
Shorthand string
Usage string
Type InputType
DefaultVal any
Required bool
Options []string // For InputChoice - valid choices
RequiresFlags []string // Flags that must be set with this one
ConflictsWith []string // Flags that cannot be used with this one
}
FlagDef defines a command argument/flag
type HandlerFunc ¶
HandlerFunc is the logic that runs for a command. It receives context, a writer for text output, and flag values. It returns a structured result and an error.
Click to show internal directories.
Click to hide internal directories.