-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathhelp.mk
More file actions
28 lines (21 loc) · 857 Bytes
/
help.mk
File metadata and controls
28 lines (21 loc) · 857 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
define help-targets
awk -F ':|## ' '/^[^\t]+\s*:[^#]*## / {printf " \033[36m%-30s\033[0m %s\n", $$1, $$NF}' $(1)
endef
define help-admins
awk -F ':|### ' '/^[^\t]+\s*:[^#]*### / {printf " * \033[36m%-30s\033[0m %s\n", $$1, $$NF}' $(1)
endef
define HELPTEXT
usage: help <command>
endef
define ADMINTEXT
Note: % stands for a service name
Note: Administrative tasks are indicated with an '*' in front of them. These tasks are intended
for trouble shooting. Do not run them unless you undestand the task action and its impact.
endef
# task comments starting with double # will be part of the help list
# task comments starting with triple # will be part of the help_admin list
help: ## Show list and info on common tasks
@echo "$$HELPTEXT"
$(call help-targets, $(MAKEFILE_LIST))
$(call help-admins, $(MAKEFILE_LIST))
@echo "$$ADMINTEXT"