godoc2md icon indicating copy to clipboard operation
godoc2md copied to clipboard

Add command line flag to specify optional output file.

Open db47h opened this issue 7 years ago • 1 comments

I run godoc2md from go generate to automatically regenerate READMEs. Since output redirection does not seem to work in //go:generate comments (probably for good reason), I need an optional -o flag to specify the output file. It's implemented so that godoc2md outputs to stdout if the flag is not specified or set to -.

db47h avatar Nov 22 '17 21:11 db47h

Just in case someone had the same problem, it can be worked around by doing something like that:

//go:generate bash -c "godoc2md -ex -template readme.tpl >README.md"

But this is hackish and not cross-platform.

db47h avatar Nov 22 '17 21:11 db47h