generalize

This commit is contained in:
Mark McGranaghan 2012-09-23 19:43:47 -07:00
parent d7f30907ed
commit 6adb905ae1

View File

@ -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"))
}