Skip to content
This repository was archived by the owner on Jul 29, 2021. It is now read-only.

Add command line flag to specify optional output file.#18

Open
db47h wants to merge 1 commit intodavecheney:masterfrom
db47h:master
Open

Add command line flag to specify optional output file.#18
db47h wants to merge 1 commit intodavecheney:masterfrom
db47h:master

Conversation

@db47h
Copy link

@db47h db47h commented Nov 22, 2017

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
Copy link
Author

db47h commented Nov 22, 2017

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.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant