dispatcher

package
v0.3.1 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Sep 6, 2025 License: MIT Imports: 8 Imported by: 0

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.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL