Documentation
¶
Overview ¶
Package dispatcher provides centralized command dispatching for pack operations. It acts as the entry point from the CLI layer, eliminating the need for individual command packages.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func Dispatch ¶
func Dispatch(cmdType CommandType, opts Options) (*display.PackCommandResult, error)
Dispatch is the central dispatcher for all pack-related commands. It replaces the individual command packages by directly calling the appropriate pack functions based on the command type.
Types ¶
type CommandType ¶
type CommandType string
CommandType represents the type of pack command being executed
const ( // Core commands CommandUp CommandType = "up" CommandDown CommandType = "down" CommandStatus CommandType = "status" // Single pack convenience commands CommandInit CommandType = "init" CommandFill CommandType = "fill" CommandAdopt CommandType = "adopt" CommandAddIgnore CommandType = "add-ignore" )
type Options ¶
type Options struct {
// Common fields
DotfilesRoot string
PackNames []string
DryRun bool
Force bool
FileSystem types.FS
// Command-specific fields
// For on command
NoProvision bool
ProvisionRerun bool
// For adopt command
SourcePaths []string
// For init command
PackName string // Single pack name for init
// For status command
Paths paths.Paths
}
Options contains all possible options for pack commands. Each command will use only the fields it needs.
Click to show internal directories.
Click to hide internal directories.