commands

package
v1.4.1 Latest Latest
Warning

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

Go to latest
Published: Aug 26, 2016 License: MIT Imports: 30 Imported by: ? modules, 0 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

Documentation

Index

Constants

View Source
const (
	PruneProgressTypeLocal  = PruneProgressType(iota)
	PruneProgressTypeRetain = PruneProgressType(iota)
	PruneProgressTypeVerify = PruneProgressType(iota)
)

Variables

View Source
var (
	// API is a package-local instance of the API client for use within
	// various command implementations.
	API = api.NewClient(nil)

	Debugging    = false
	ErrorBuffer  = &bytes.Buffer{}
	ErrorWriter  = io.MultiWriter(os.Stderr, ErrorBuffer)
	OutputWriter = io.MultiWriter(os.Stdout, ErrorBuffer)
	ManPages     = make(map[string]string, 20)
)

Functions

func Cleanup added in v1.3.1

func Cleanup()

func Debug

func Debug(format string, args ...interface{})

Debug prints a formatted message if debugging is enabled. The formatted message also shows up in the panic log, if created.

func Error

func Error(format string, args ...interface{})

Error prints a formatted message to Stderr. It also gets printed to the panic log if one is created for this command.

func Exit

func Exit(format string, args ...interface{})

Exit prints a formatted message and exits.

func ExitWithError added in v1.1.2

func ExitWithError(err error)

ExitWithError either panics with a full stack trace for fatal errors, or simply prints the error message and exits immediately.

func FullError added in v1.4.0

func FullError(err error)

FullError prints either a full stack trace for fatal errors, or just the error message.

func LoggedError

func LoggedError(err error, format string, args ...interface{})

LoggedError prints a formatted message to Stderr and writes a stack trace for the error to a log file without exiting.

func Panic

func Panic(err error, format string, args ...interface{})

Panic prints a formatted message, and writes a stack trace for the error to a log file before exiting.

func PipeCommand

func PipeCommand(name string, args ...string) error

func PipeMediaCommand

func PipeMediaCommand(name string, args ...string) error

func Print

func Print(format string, args ...interface{})

Print prints a formatted message to Stdout. It also gets printed to the panic log if one is created for this command.

func RegisterSubcommand added in v1.4.0

func RegisterSubcommand(fn func() *cobra.Command)

func Run

func Run()

func TransferManifest added in v1.4.0

func TransferManifest() *transfer.Manifest

TransferManifest builds a transfer.Manifest from the commands package global cfg var.

Types

type PruneProgress added in v1.1.0

type PruneProgress struct {
	ProgressType PruneProgressType
	Count        int // Number of items done
}

Progress from a sub-task of prune

type PruneProgressChan added in v1.1.0

type PruneProgressChan chan PruneProgress

type PruneProgressType added in v1.1.0

type PruneProgressType int

Jump to

Keyboard shortcuts

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