Documentation ¶
Overview ¶
Package cmd contains various facilities for the command line portion of Mutagen.
Index ¶
Constants ¶
This section is empty.
Variables ¶
TerminationSignals are those signals which Mutagen considers to be requesting termination.
Functions ¶
func Fatal ¶
func Fatal(err error)
Fatal prints an error message to standard error and then terminates the process with an error exit code.
func HandleTerminalCompatibility ¶ added in v0.6.0
func HandleTerminalCompatibility()
HandleTerminalCompatibility automatically restarts the current process inside a terminal compatibility emulator if necessary. It currently only handles the case of mintty consoles on Windows requiring a relaunch of the current command inside winpty.
func Mainify ¶ added in v0.3.0
Mainify is a small utility that wraps a non-standard Cobra entry point (one returning an error) and generates a standard Cobra entry point. It's useful for entry points to be able to rely on defer-based cleanup, which doesn't occur if the entry point terminates the process. This method allows the entry point to indicate an error while still performing cleanup.
Types ¶
type StatusLinePrinter ¶ added in v0.6.0
type StatusLinePrinter struct {
// contains filtered or unexported fields
}
StatusLinePrinter provides printing facilities for dynamically updating status lines in the console. It supports colorized printing.
func (*StatusLinePrinter) BreakIfNonEmpty ¶ added in v0.6.0
func (p *StatusLinePrinter) BreakIfNonEmpty()
BreakIfNonEmpty prints a newline character if the current line is non-empty.
func (*StatusLinePrinter) Clear ¶ added in v0.6.0
func (p *StatusLinePrinter) Clear()
Clear clears any content on the status line and moves the cursor back to the beginning of the line.
func (*StatusLinePrinter) Print ¶ added in v0.6.0
func (p *StatusLinePrinter) Print(message string)
Print prints a message to the status line, overwriting any existing content. Color escape sequences are supported. Messages will be truncated to a platform-dependent maximum length and padded appropriately.