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(
|
||||
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,
|
||||
|
|
|
@ -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 %#
|
||||
|
|
|
@ -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
11
task.mk
|
@ -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)",
|
||||
|
|
Loading…
Reference in a new issue