Documentation
¶
Index ¶
- Variables
- func Confirm(message string) (bool, error)
- func ConfirmRemoval(count int) (bool, error)
- func ConfirmSaveSyncConfig() (bool, error)
- func ConfirmScaffold(branch string) (bool, error)
- func ConfirmSync(currentBranch, upstream, strategy string) (bool, error)
- func IsAbort(err error) bool
- func IsInteractive() bool
- func NormalizeAbort(err error) error
- func PrintDone(msg string)
- func PrintError(msg string)
- func PrintErrorWithHint(msg, hint string)
- func PrintInfo(msg string)
- func PrintStep(msg string)
- func PrintSuccess(msg string)
- func PrintSuccessPath(msg, path string)
- func PrintWarning(msg string)
- func PromptNewBranch() (string, error)
- func RenderStatusTable(rows [][]string) string
- func RenderWorktreeTable(worktrees []git.Worktree) string
- func RunWithSpinner(title string, action func() error) error
- func SelectBranchInteractive(barePath string, localBranches, remoteBranches []string) (string, error)
- func SelectSyncStrategy(defaultStrategy string) (string, error)
- func SelectUpstreamBranch(localBranches, remoteBranches []string, defaultBranch string) (string, error)
- func SelectWorktreeToRemove(worktrees []git.Worktree) (*git.Worktree, error)
- func SelectWorktreeToScaffold(worktrees []git.Worktree) (*git.Worktree, error)
- func SelectWorktreesToPrune(removable []git.Worktree) ([]git.Worktree, error)
- func ShouldPrompt(cmd *cobra.Command, hasRequiredArgs bool) bool
Constants ¶
This section is empty.
Variables ¶
var ( Primary = lipgloss.Color("#4CAF50") Secondary = lipgloss.Color("#A1887F") ColorSuccess = lipgloss.Color("#66BB6A") ColorWarning = lipgloss.Color("#FFA726") ColorError = lipgloss.Color("#EF5350") ColorInfo = lipgloss.Color("#29B6F6") ColorMuted = lipgloss.AdaptiveColor{Dark: "#9E9E9E", Light: "#555555"} Text = lipgloss.AdaptiveColor{Dark: "#F9FAFB", Light: "#111111"} TextDim = lipgloss.AdaptiveColor{Dark: "#9CA3AF", Light: "#6B7280"} )
var ( HeaderStyle = lipgloss.NewStyle(). Bold(true). Foreground(Primary). MarginBottom(1) SuccessBadge = lipgloss.NewStyle(). Foreground(lipgloss.Color("#000")). Background(ColorSuccess). Padding(0, 1). Bold(true) WarningBadge = lipgloss.NewStyle(). Foreground(lipgloss.Color("#000")). Background(ColorWarning). Padding(0, 1). Bold(true) ErrorBadge = lipgloss.NewStyle(). Foreground(lipgloss.Color("#FFF")). Background(ColorError). Padding(0, 1). Bold(true) BoxStyle = lipgloss.NewStyle(). Border(lipgloss.RoundedBorder()). BorderForeground(Primary). Padding(1, 2) MutedStyle = lipgloss.NewStyle(). Foreground(ColorMuted) CodeStyle = lipgloss.NewStyle(). Foreground(ColorInfo). Bold(true) InfoBadge = lipgloss.NewStyle(). Foreground(lipgloss.Color("#000")). Background(ColorInfo). Padding(0, 1). Bold(true) MainWorktreeStyle = lipgloss.NewStyle(). Foreground(Secondary). Bold(true) CurrentWorktreeStyle = lipgloss.NewStyle(). Foreground(ColorSuccess). Bold(true) )
var ErrUserAborted = errors.New("user aborted")
ErrUserAborted is returned when the user aborts an interactive prompt. This sentinel error normalizes various abort signals (Ctrl+C, Esc, Ctrl+D, etc.) into a single error that can be handled centrally.
Functions ¶
func ConfirmRemoval ¶
func ConfirmSaveSyncConfig ¶
ConfirmSaveSyncConfig asks user if they want to save sync settings to anvil.yaml
func ConfirmScaffold ¶
ConfirmScaffold prompts user to confirm scaffolding current worktree
func ConfirmSync ¶
ConfirmSync prompts user to confirm running sync operation
func IsInteractive ¶
func IsInteractive() bool
func NormalizeAbort ¶
NormalizeAbort converts known abort-like errors to ErrUserAborted. This includes huh.ErrUserAborted (Esc/Ctrl+C in huh prompts), io.EOF (Ctrl+D/closed stdin), and context.Canceled.
func PrintError ¶
func PrintError(msg string)
func PrintErrorWithHint ¶
func PrintErrorWithHint(msg, hint string)
func PrintSuccess ¶
func PrintSuccess(msg string)
func PrintSuccessPath ¶
func PrintSuccessPath(msg, path string)
func PrintWarning ¶
func PrintWarning(msg string)
func PromptNewBranch ¶
func RenderStatusTable ¶
func RenderWorktreeTable ¶
func RunWithSpinner ¶
func SelectBranchInteractive ¶
func SelectSyncStrategy ¶
SelectSyncStrategy prompts user to choose between rebase and merge
func SelectUpstreamBranch ¶
func SelectUpstreamBranch(localBranches, remoteBranches []string, defaultBranch string) (string, error)
SelectUpstreamBranch prompts user to select an upstream branch Defaults to the defaultBranch option if available
func SelectWorktreeToRemove ¶
func SelectWorktreeToScaffold ¶
SelectWorktreeToScaffold allows selecting a worktree to scaffold
func SelectWorktreesToPrune ¶
Types ¶
This section is empty.