Skip to content

Instantly share code, notes, and snippets.

@luzfcb
Created July 21, 2020 22:55
Show Gist options
  • Save luzfcb/88b43c4f69c943841a155e693fccdeae to your computer and use it in GitHub Desktop.
Save luzfcb/88b43c4f69c943841a155e693fccdeae to your computer and use it in GitHub Desktop.
.DEFAULT_GOAL := help
define PRINT_HELP_PYSCRIPT
import re, sys
output = []
for line in sys.stdin:
match = re.match(r'^([a-zA-Z_-]+):.*?## (.*)$$', line)
if match:
target, help = match.groups()
output.append("%-20s %s" % (target, help))
output.sort()
print('\n'.join(output))
endef
export PRINT_HELP_PYSCRIPT
help: ## The command that generated this list
@python -c "$$PRINT_HELP_PYSCRIPT" < $(MAKEFILE_LIST)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment