mirror of
https://github.com/daylinmorgan/task.mk.git
synced 2024-12-22 01:50:44 -06:00
chore: add some helpful notes about make variables
This commit is contained in:
parent
365e0e1353
commit
3873df00ce
4 changed files with 13 additions and 10 deletions
|
@ -23,17 +23,17 @@ MaxLens = namedtuple("MaxLens", "goal msg")
|
||||||
pattern = re.compile(
|
pattern = re.compile(
|
||||||
r"""
|
r"""
|
||||||
(?:
|
(?:
|
||||||
^\#\#\#\s+
|
^\#\#\#\s+ # <- raw message
|
||||||
|
|
|
|
||||||
^(?:
|
^(?:
|
||||||
(?:\#\#\s+)?
|
(?:\#\#\s+)?
|
||||||
(?P<goal>.*?)(?:\s+\|>|:.*?\#\#)\s+
|
(?P<goal>.*?)(?:\s+\|>|:.*?\#\#)\s+
|
||||||
|
) # <- a custom goal or actual recipe
|
||||||
)
|
)
|
||||||
)
|
(?P<msg>.*?)?\s? # <- help text (optional)
|
||||||
(?P<msg>.*?)?\s?
|
|
||||||
(?:\|>\s+
|
(?:\|>\s+
|
||||||
(?P<msgargs>.*?)
|
(?P<msgargs>.*?)
|
||||||
)?
|
)? # <- style args (optional)
|
||||||
$$
|
$$
|
||||||
""",
|
""",
|
||||||
re.X,
|
re.X,
|
||||||
|
|
|
@ -3,5 +3,6 @@
|
||||||
#% block script %#
|
#% block script %#
|
||||||
##- '$(utils_py)' -##
|
##- '$(utils_py)' -##
|
||||||
###- sys is imported with utils_py -###
|
###- sys is imported with utils_py -###
|
||||||
|
###- $(2) f-string from task.mk -###
|
||||||
sys.stderr.write(f"""$(2)\n""")
|
sys.stderr.write(f"""$(2)\n""")
|
||||||
#% endblock %#
|
#% endblock %#
|
||||||
|
|
|
@ -96,7 +96,7 @@ class Ansi:
|
||||||
sys.exit(1)
|
sys.exit(1)
|
||||||
|
|
||||||
return code + end
|
return code + end
|
||||||
|
###- the below $() variables are injected by make -###
|
||||||
def add_cfg(self):
|
def add_cfg(self):
|
||||||
cfg_styles = {
|
cfg_styles = {
|
||||||
"header": "$(HEADER_STYLE)",
|
"header": "$(HEADER_STYLE)",
|
||||||
|
@ -118,6 +118,7 @@ class Ansi:
|
||||||
|
|
||||||
|
|
||||||
a = ansi = Ansi()
|
a = ansi = Ansi()
|
||||||
|
###- the below $() variables are injected by make -###
|
||||||
cfg = Config(
|
cfg = Config(
|
||||||
"$(DIVIDER)", "$(HELP_SEP)", f"""$(EPILOG)""", f"""$(USAGE)""", int("$(WRAP)")
|
"$(DIVIDER)", "$(HELP_SEP)", f"""$(EPILOG)""", f"""$(USAGE)""", int("$(WRAP)")
|
||||||
)
|
)
|
||||||
|
|
11
task.mk
11
task.mk
|
@ -1,7 +1,7 @@
|
||||||
# }> [github.com/daylinmorgan/task.mk] <{ #
|
# }> [github.com/daylinmorgan/task.mk] <{ #
|
||||||
# Copyright (c) 2022 Daylin Morgan
|
# Copyright (c) 2022 Daylin Morgan
|
||||||
# MIT License
|
# 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`
|
# 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.
|
# 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(
|
pattern = re.compile(
|
||||||
r"""
|
r"""
|
||||||
(?:
|
(?:
|
||||||
^\#\#\#\s+
|
^\#\#\#\s+ # <- raw message
|
||||||
|
|
|
|
||||||
^(?:
|
^(?:
|
||||||
(?:\#\#\s+)?
|
(?:\#\#\s+)?
|
||||||
(?P<goal>.*?)(?:\s+\|>|:.*?\#\#)\s+
|
(?P<goal>.*?)(?:\s+\|>|:.*?\#\#)\s+
|
||||||
|
) # <- a custom goal or actual recipe
|
||||||
)
|
)
|
||||||
)
|
(?P<msg>.*?)?\s? # <- help text (optional)
|
||||||
(?P<msg>.*?)?\s?
|
|
||||||
(?:\|>\s+
|
(?:\|>\s+
|
||||||
(?P<msgargs>.*?)
|
(?P<msgargs>.*?)
|
||||||
)?
|
)? # <- style args (optional)
|
||||||
$$
|
$$
|
||||||
""",
|
""",
|
||||||
re.X,
|
re.X,
|
||||||
|
@ -391,6 +391,7 @@ class Ansi:
|
||||||
print("Expected one or three values for bg as a list")
|
print("Expected one or three values for bg as a list")
|
||||||
sys.exit(1)
|
sys.exit(1)
|
||||||
return code + end
|
return code + end
|
||||||
|
|
||||||
def add_cfg(self):
|
def add_cfg(self):
|
||||||
cfg_styles = {
|
cfg_styles = {
|
||||||
"header": "$(HEADER_STYLE)",
|
"header": "$(HEADER_STYLE)",
|
||||||
|
|
Loading…
Reference in a new issue