chore: add some helpful notes about make variables

This commit is contained in:
Daylin Morgan 2023-01-20 12:23:03 -06:00
parent 365e0e1353
commit 3873df00ce
4 changed files with 13 additions and 10 deletions

View File

@ -23,17 +23,17 @@ MaxLens = namedtuple("MaxLens", "goal msg")
pattern = re.compile(
r"""
(?:
^\#\#\#\s+
^\#\#\#\s+ # <- raw message
|
^(?:
(?:\#\#\s+)?
(?P<goal>.*?)(?:\s+\|>|:.*?\#\#)\s+
)
) # <- a custom goal or actual recipe
)
(?P<msg>.*?)?\s?
(?P<msg>.*?)?\s? # <- help text (optional)
(?:\|>\s+
(?P<msgargs>.*?)
)?
)? # <- style args (optional)
$$
""",
re.X,

View File

@ -3,5 +3,6 @@
#% block script %#
##- '$(utils_py)' -##
###- sys is imported with utils_py -###
###- $(2) f-string from task.mk -###
sys.stderr.write(f"""$(2)\n""")
#% endblock %#

View File

@ -96,7 +96,7 @@ class Ansi:
sys.exit(1)
return code + end
###- the below $() variables are injected by make -###
def add_cfg(self):
cfg_styles = {
"header": "$(HEADER_STYLE)",
@ -118,6 +118,7 @@ class Ansi:
a = ansi = Ansi()
###- the below $() variables are injected by make -###
cfg = Config(
"$(DIVIDER)", "$(HELP_SEP)", f"""$(EPILOG)""", f"""$(USAGE)""", int("$(WRAP)")
)

11
task.mk
View File

@ -1,7 +1,7 @@
# }> [github.com/daylinmorgan/task.mk] <{ #
# Copyright (c) 2022 Daylin Morgan
# MIT License
# version: v22.9.28-16-g920c7c2dev
# version: v22.9.28-17-g365e0e1dev
#
# task.mk should be included at the bottom of your Makefile with `-include .task.mk`
# See below for the standard configuration options that should be set prior to including this file.
@ -90,17 +90,17 @@ MaxLens = namedtuple("MaxLens", "goal msg")
pattern = re.compile(
r"""
(?:
^\#\#\#\s+
^\#\#\#\s+ # <- raw message
|
^(?:
(?:\#\#\s+)?
(?P<goal>.*?)(?:\s+\|>|:.*?\#\#)\s+
)
) # <- a custom goal or actual recipe
)
(?P<msg>.*?)?\s?
(?P<msg>.*?)?\s? # <- help text (optional)
(?:\|>\s+
(?P<msgargs>.*?)
)?
)? # <- style args (optional)
$$
""",
re.X,
@ -391,6 +391,7 @@ class Ansi:
print("Expected one or three values for bg as a list")
sys.exit(1)
return code + end
def add_cfg(self):
cfg_styles = {
"header": "$(HEADER_STYLE)",