output

package
v0.1.2 Latest Latest
Warning

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

Go to latest
Published: Feb 25, 2026 License: MIT Imports: 3 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func FormatStatusLabel

func FormatStatusLabel(action string) string

FormatStatusLabel returns the text label for a repo action.

func FormatSummaryLine

func FormatSummaryLine(total, cloned, updated, dirty, branchDrift, unknown, excluded, errors int) string

FormatSummaryLine builds a plain-text summary line (for testing).

func IsTerminalOutput

func IsTerminalOutput() bool

IsTerminalOutput returns true when stdout is a terminal.

func ShouldColor

func ShouldColor() bool

ShouldColor returns true if color output is enabled.

Types

type DirtyFileInfo

type DirtyFileInfo struct {
	Path     string
	Staged   bool
	Unstaged bool
}

DirtyFileInfo is a simple struct for passing to Printer.

type Printer

type Printer struct {
	// contains filtered or unexported fields
}

Printer handles formatted output with optional color support.

func NewPrinter

func NewPrinter(color bool, verbose bool) *Printer

NewPrinter creates a new Printer. color: whether to enable ANSI color output verbose: whether to show verbose output

func (*Printer) AdvanceRepoProgress

func (p *Printer) AdvanceRepoProgress()

AdvanceRepoProgress increments the repository progress bar by one.

func (*Printer) AuthError

func (p *Printer) AuthError(err error)

AuthError prints an authentication error message.

func (*Printer) Collision

func (p *Printer) Collision(name, detail string)

Collision prints a path collision finding.

func (*Printer) ConfigError

func (p *Printer) ConfigError(err error)

ConfigError prints a configuration error message.

func (*Printer) ExcludedButPresent

func (p *Printer) ExcludedButPresent(name string)

ExcludedButPresent prints an excluded-but-present finding.

func (*Printer) FinishRepoProgress

func (p *Printer) FinishRepoProgress()

FinishRepoProgress renders the completed progress line and moves to the next line.

func (*Printer) Header

func (p *Printer) Header(text string)

Header prints a section header.

func (*Printer) MissingDotfile

func (p *Printer) MissingDotfile(filename string)

MissingDotfile prints the message when .ghorgsync is not found.

func (*Printer) RepoBranchDrift

func (p *Printer) RepoBranchDrift(name, fromBranch, toBranch string, updated bool)

RepoBranchDrift prints a branch drift finding with checkout action.

func (*Printer) RepoCloned

func (p *Printer) RepoCloned(name string)

RepoCloned prints a clone action.

func (*Printer) RepoDirty

func (p *Printer) RepoDirty(name, currentBranch, defaultBranch string, files []DirtyFileInfo, additions, deletions int)

RepoDirty prints a dirty repo finding.

func (*Printer) RepoError

func (p *Printer) RepoError(name, action string, err error)

RepoError prints a repo-level error.

func (*Printer) RepoUpdated

func (p *Printer) RepoUpdated(name string)

RepoUpdated prints an update action.

func (*Printer) StartRepoProgress

func (p *Printer) StartRepoProgress(total int)

StartRepoProgress starts a live progress line for repository processing.

func (*Printer) Summary

func (p *Printer) Summary(total, cloned, updated, dirty, branchDrift, unknown, excluded, errors int)

Summary prints the final summary block.

func (*Printer) SystemError

func (p *Printer) SystemError(context string, err error)

SystemError prints a system-level error.

func (*Printer) UnknownFolder

func (p *Printer) UnknownFolder(name string)

UnknownFolder prints an unknown folder finding.

func (*Printer) Verbose

func (p *Printer) Verbose(format string, args ...interface{})

Verbose prints a message only in verbose mode.

Jump to

Keyboard shortcuts

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