Nice article, thanks :) We use this to auto document our makefiles (see marmelab.com/blog/2016/02/29/auto-...), I thought you might find it interesting:
help: @grep -E '^[a-zA-Z_-]+:.*?## .*$$' $(MAKEFILE_LIST) | sort | awk 'BEGIN {FS = ":.*?## "}; {printf "\033[36m%-30s\033[0m %s\n", $$1, $$2}' clean: ## Cleanup rm -rf $(BUILDDIR)/*.o $(BUILDDIR)/$(EXEC)
The help command show a list of all commands with associated help extracted from the comments (##)
##
Aha! Very cool, thanks for sharing. Much better than hardcoding.
Are you sure you want to hide this comment? It will become hidden in your post, but will still be visible via the comment's permalink.
Hide child comments as well
Confirm
For further actions, you may consider blocking this person and/or reporting abuse
We're a place where coders share, stay up-to-date and grow their careers.
Nice article, thanks :) We use this to auto document our makefiles (see marmelab.com/blog/2016/02/29/auto-...), I thought you might find it interesting:
The help command show a list of all commands with associated help extracted from the comments (
##
)Aha! Very cool, thanks for sharing. Much better than hardcoding.