Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func NewCommandManagementCommandGroup ¶
func NewCommandManagementCommandGroup( allCommands []glazed_cmds.Command, options ...Option, ) (*cobra.Command, error)
NewCommandManagementCommandGroup creates a new Cobra command group for managing commands. It includes subcommands for listing/filtering ('list') and editing ('edit').
Types ¶
type AddCommandToRowFunc ¶
type AddCommandToRowFunc func(cmd glazed_cmds.Command, row types.Row, parsedLayers *layers.ParsedLayers) ([]types.Row, error)
AddCommandToRowFunc is a function type that allows customization of the row output for each command. It takes the original command, the base row generated by the list command, and the parsed layers. It should return one or more rows (allowing expansion or modification) or an error.
type CommandManagementConfig ¶
type CommandManagementConfig struct {
ListAddCommandToRowFunc AddCommandToRowFunc
}
CommandManagementConfig holds configuration options for the command management group.
type EditCommand ¶
type EditCommand struct {
*glazed_cmds.CommandDescription
// contains filtered or unexported fields
}
EditCommand implements the command to edit the source file of another command.
func (*EditCommand) Run ¶
func (c *EditCommand) Run(ctx context.Context, parsedLayers *layers.ParsedLayers) error
Run executes the edit command.
type EditCommandSettings ¶
type EditCommandSettings struct {
CommandPath string `glazed.parameter:"command-path"`
}
EditCommandSettings holds the arguments for the edit command.
type ListCommand ¶
type ListCommand struct {
*glazed_cmds.CommandDescription
// contains filtered or unexported fields
}
ListCommand integrates filtering and listing of commands.
func (*ListCommand) RunIntoGlazeProcessor ¶
func (c *ListCommand) RunIntoGlazeProcessor( ctx context.Context, parsedLayers *layers.ParsedLayers, gp middlewares.Processor, ) error
RunIntoGlazeProcessor executes the list command, filtering and outputting results.
type Option ¶
type Option func(*CommandManagementConfig)
Option defines a function signature for configuring CommandManagementConfig.
func WithListAddCommandToRowFunc ¶
func WithListAddCommandToRowFunc(f AddCommandToRowFunc) Option
WithListAddCommandToRowFunc provides an option to set the AddCommandToRowFunc for the list command.