github.com/kcmerrill/alfred@v0.0.0-20180727171036-06445dcb5e3d/pkg/alfred/plugin.go (about)

     1  package alfred
     2  
     3  import (
     4  	"github.com/kcmerrill/hook"
     5  )
     6  
     7  func plugin(task Task, context *Context, tasks map[string]Task) {
     8  	// register our plugins
     9  	if len(task.Plugin) == 0 {
    10  		return
    11  	}
    12  
    13  	// sweet ... we have plugins.
    14  	for key, value := range task.Plugin {
    15  		hook.Register(key, value)
    16  		outOK("plugin {{ .Text.Args }}"+key+"{{ .Text.Reset }}", value, context)
    17  	}
    18  }