From 6adb905ae19d4a6a66178229324f0edc39bd3f9d Mon Sep 17 00:00:00 2001 From: Mark McGranaghan Date: Sun, 23 Sep 2012 19:43:47 -0700 Subject: [PATCH] generalize --- tool/generate.go | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/tool/generate.go b/tool/generate.go index 2629140..5d12afd 100644 --- a/tool/generate.go +++ b/tool/generate.go @@ -16,8 +16,8 @@ func check(err error) { } } -func pipedCmd(path, source string) string { - cmd := exec.Command(path) +func pipedCmd(path string, argv []string, source string) string { + cmd := exec.Command(path, argv...) in, err := cmd.StdinPipe() check(err) out, err := cmd.StdoutPipe() @@ -46,9 +46,8 @@ func main() { // binaries, remember their paths. markdownPath, err := exec.LookPath("markdown"); check(err) - fmt.Print(pipedCmd(markdownPath, "## wat")) // pygmentizePath, err := exec.LookPath("pygmentize") // check(err) - // + fmt.Print(pipedCmd(markdownPath, []string{}, "## wat")) }