Documentation ¶
Index ¶
Constants ¶
View Source
const (
HelpOpcode string = "help"
)
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type CommandInfo ¶
type CommandInfo struct {
// contains filtered or unexported fields
}
func NewCommandInfo ¶
func NewCommandInfo(description string, fn ConsoleFunc, args []string) *CommandInfo
type Console ¶
type Console struct {
// contains filtered or unexported fields
}
func NewConsole ¶
func NewConsole() *Console
func (*Console) AddCommand ¶
func (c *Console) AddCommand(name string, info *CommandInfo)
type ParsedCommand ¶
type ParsedCommand struct {
// contains filtered or unexported fields
}
func NewParsedCommand ¶
func NewParsedCommand(command string, flagMap map[string]any, fn ConsoleFunc) *ParsedCommand
func (*ParsedCommand) Execute ¶
func (pc *ParsedCommand) Execute() (any, error)
Execute executes the command with the given flags.
Returns:
- error: An error if the command failed to execute.
func (*ParsedCommand) GetCommand ¶
func (pc *ParsedCommand) GetCommand() string
GetCommand returns the name of the command.
Click to show internal directories.
Click to hide internal directories.