Skip to content

cjtoolkit/taskforce

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

10 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Build Status

TaskForce

a simple, functional task runner without the plugin nonsense!

package main

import (
	"fmt"
	"os"

	"github.com/cjtoolkit/taskforce"
)

func task() *taskforce.TaskForce {
	tf := taskforce.InitTaskForce()

	tf.Register("hello", func() {
		fmt.Println("Hello,")
	})

	tf.Register("world", func() {
		fmt.Println("World.")
	})

	tf.Register("echo-world", func() {
		tf.ExecCmd("echo", "world")
	})

	tf.Register("both", func() {
		tf.Run("hello", "world")
	})

	return tf
}

func main() {
	task().Run(os.Args[1:]...)
}