Documentation
¶
Overview ¶
Package cmd contains utilities for command line tools.
Index ¶
Constants ¶
const (
DelimiterLine = "--------------------------------------------------------------------------------"
)
Variables ¶
var PerformingShellCompletion bool
PerformingShellCompletion indicates whether or not one of Cobra's hidden shell completion commands is being used.
TerminationSignals are those signals which Mutagen considers to be requesting termination. Certain other signals that also request termination (such as SIGABRT) are intentionally ignored because they're handled by the Go runtime and have special behavior (such as dumping a stack trace). Both SIGINT and SIGTERM are emulated on Windows (SIGINT on Ctrl-C and Ctrl-Break and SIGTERM on CTRL_CLOSE_EVENT, CTRL_LOGOFF_EVENT, and CTRL_SHUTDOWN_EVENT).
Functions ¶
func DisallowArguments ¶ added in v0.13.0
DisallowArguments is a Cobra arguments validator that disallows positional arguments. It is an alternative to cobra.NoArgs, which treats arguments as command names and returns a somewhat cryptic error message.
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.
Types ¶
type StatusLinePrinter ¶ added in v0.6.0
type StatusLinePrinter struct { // UseStandardError causes the printer to use standard error for its output // instead of standard output (the default). UseStandardError bool // 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.
type StatusLinePrompter ¶ added in v0.13.0
type StatusLinePrompter struct { // Printer is the underlying printer. Printer *StatusLinePrinter }
StatusLinePrompter adapts a StatusLinePrinter to act as a Mutagen prompter. The printer will be used to perform messaging and PromptCommandLine will be used to perform prompting.
func (*StatusLinePrompter) Message ¶ added in v0.13.0
func (p *StatusLinePrompter) Message(message string) error
Message implements prompting.Prompter.Message.
Source Files
¶
Directories
¶
Path | Synopsis |
---|---|
Package external contains flags that external tools using Mutagen cmd packages can use to opt-in to certain behaviors.
|
Package external contains flags that external tools using Mutagen cmd packages can use to opt-in to certain behaviors. |