grift: Index | Files

package grift

import ""


Package Files

context.go grift.go


var CommandName = "grift"

func Add Uses

func Add(name string, grift Grift) error

Add a grift. If there is already a grift with the given name the two grifts will be bundled together.

func Desc Uses

func Desc(name string, description string) error

Desc sets a helpful descriptive text for a grift. This description will be shown when `grift list` is run.

func Exec Uses

func Exec(args []string, verbose bool) error

Exec the grift stack. This is the main "entry point" to the grift system.

func List Uses

func List() []string

List of the names of the defined grifts.

func Namespace Uses

func Namespace(name string, s func()) error

Namespace will place all tasks within the given prefix.

func PrintGrifts Uses

func PrintGrifts(w io.Writer)

PrintGrifts to the screen, nice, sorted, and with descriptions, should they exist.

func Remove Uses

func Remove(name string) error

Remove a grift. Not incredibly useful, but here for completeness.

func Rename Uses

func Rename(oldName string, newName string) error

Rename a grift. Useful if you want to re-define an existing grift, but don't want to write over the original.

func Run Uses

func Run(name string, c *Context) error

Run a grift. This allows for the chaining for grifts. One grift can Run another grift and so on.

func RunSource Uses

func RunSource(cmd *exec.Cmd) error

RunSource executes the command passed as argument, in the current shell/context

func Set Uses

func Set(name string, grift Grift) error

Set a grift. This is similar to `Add` but it will overwrite an existing grift with the same name.

type Context Uses

type Context struct {
    Name    string
    Args    []string
    Verbose bool
    // contains filtered or unexported fields

Context used to pass information between grifts

func NewContext Uses

func NewContext(name string) *Context

NewContext builds and returns a new default Context.

func NewContextWithContext Uses

func NewContextWithContext(name string, ctx context.Context) *Context

NewContextWithContext builds and returns a new default Context given an existing context

func (*Context) Set Uses

func (c *Context) Set(key string, val interface{})

Set a piece of data onto the Context.

func (*Context) Value Uses

func (c *Context) Value(key interface{}) interface{}

Value returns a value from the context for the given key

type Grift Uses

type Grift func(c *Context) error

Package grift imports 10 packages (graph) and is imported by 77 packages. Updated 2018-06-11. Refresh now. Tools for package owners.