tasking

package
v0.0.0-...-0041ef5 Latest Latest
Warning

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

Go to latest
Published: Dec 2, 2013 License: MIT Imports: 7 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Flags

type Flags struct {
	C *cli.Context
}

Flags can be used to retrieve parsed command-line options.

func (Flags) Bool

func (f Flags) Bool(name string) bool

Bool looks up the value of a bool flag, returns false if no bool flag exists

type T

type T struct {
	Args  []string // command-line arguments
	Flags Flags    // command-line options
	// contains filtered or unexported fields
}

T is a type that is passed through to each task function. T can be used to retrieve context-specific Args and parsed command-line Flags.

func (*T) Error

func (t *T) Error(args ...interface{})

Error is equivalent to Log followed by Fail.

func (*T) Errorf

func (t *T) Errorf(format string, args ...interface{})

Errorf is equivalent to Logf followed by Fail.

func (*T) Exec

func (t *T) Exec(cmd ...string) (err error)

Exec runs the system command. If multiple arguments are given, they're concatenated to one command.

Example:

t.Exec("ls -ltr")
t.Exec("ls", FILE1, FILE2)

func (*T) Fail

func (t *T) Fail()

Fail marks the task as having failed but continues execution.

func (*T) Failed

func (t *T) Failed() bool

Failed checks if the task has failed

func (*T) Fatal

func (t *T) Fatal(args ...interface{})

Fatal is equivalent to Error followed by a call to os.Exit(1).

func (*T) Fatalf

func (t *T) Fatalf(format string, args ...interface{})

Fatalf is equivalent to Errorf followed by a call to os.Exit(1).

func (*T) Log

func (t *T) Log(args ...interface{})

Log formats its arguments using default formatting, analogous to Println.

func (*T) Logf

func (t *T) Logf(format string, args ...interface{})

Logf formats its arguments according to the format, analogous to Printf.

Jump to

Keyboard shortcuts

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