func showTasksOf(ctx *runtime.Runtime) { tasks := ctx.TaskIDList() sort.Strings(tasks) for _, id := range tasks { fmt.Println(id) } }
func runControlScriptOn(ctx *runtime.Runtime) error { if controlScript != "" { return ctx.RunString(controlScript) } filename := controlFile if _, err := os.Stat(filename); os.IsNotExist(err) { filename += ".md" } if _, err := os.Stat(filename); os.IsNotExist(err) { return fmt.Errorf("Control file %v (and %v.md) not found", filename, filename) } if strings.HasSuffix(filename, ".md") { return ctx.RunLiterateFile(filename) } return ctx.RunFile(filename) }