mutagen: github.com/mutagen-io/mutagen/cmd Index | Files | Directories

package cmd

import "github.com/mutagen-io/mutagen/cmd"

Package cmd contains utilities for command line tools.

Index

Package Files

arguments.go completion.go delimiter_posix.go doc.go error.go output.go output_posix.go signals_posix.go terminal_posix.go

Constants

const (
    DelimiterLine = "--------------------------------------------------------------------------------"
)

Variables

var PerformingShellCompletion bool

PerformingShellCompletion indicates whether or not one of Cobra's hidden shell completion commands is being used.

var TerminationSignals = []os.Signal{
    syscall.SIGINT,
    syscall.SIGTERM,
}

TerminationSignals are those signals which Mutagen considers to be requesting termination.

func DisallowArguments Uses

func DisallowArguments(_ *cobra.Command, arguments []string) error

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 Error Uses

func Error(err error)

Error prints an error message to standard error.

func Fatal Uses

func Fatal(err error)

Fatal prints an error message to standard error and then terminates the process with an error exit code.

func HandleTerminalCompatibility Uses

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 Warning Uses

func Warning(message string)

Warning prints a warning message to standard error.

type StatusLinePrinter Uses

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 Uses

func (p *StatusLinePrinter) BreakIfNonEmpty()

BreakIfNonEmpty prints a newline character if the current line is non-empty.

func (*StatusLinePrinter) Clear Uses

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 Uses

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 Uses

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 Uses

func (p *StatusLinePrompter) Message(message string) error

Message implements prompting.Prompter.Message.

func (*StatusLinePrompter) Prompt Uses

func (p *StatusLinePrompter) Prompt(message string) (string, error)

Prompt implements prompting.Prompter.Prompt.

Directories

PathSynopsis
mutagen
mutagen-agent
mutagen/daemon
mutagen/forward
mutagen/project
mutagen/sync
mutagen/tunnel
profile

Package cmd imports 7 packages (graph) and is imported by 20 packages. Updated 2020-07-07. Refresh now. Tools for package owners.