Created
February 13, 2018 07:37
-
-
Save kitzberger/3465b1ad0f6149cc4a86b6cfc5bdaefa to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Help based on https://gist.github.com/prwhite/8168133 thanks to @nowox and @prwhite | |
# And add help text after each target name starting with '\#\#' | |
# A category can be added with @category | |
HELP_FUN = \ | |
%help; \ | |
while(<>) { push @{$$help{$$2 // 'options'}}, [$$1, $$3] if /^([\w-]+)\s*:.*\#\#(?:@([\w-]+))?\s(.*)$$/ }; \ | |
print "\nusage: make [target ...]\n\n"; \ | |
for (keys %help) { \ | |
print "$$_:\n"; \ | |
for (@{$$help{$$_}}) { \ | |
$$sep = "." x (25 - length $$_->[0]); \ | |
print " $$_->[0]$$sep$$_->[1]\n"; \ | |
} \ | |
print "\n"; \ | |
} | |
help: ##@system show this help | |
@perl -e '$(HELP_FUN)' $(MAKEFILE_LIST) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment