mirror of
https://github.com/daylinmorgan/task.mk.git
synced 2024-12-21 17:40:45 -06:00
feat: add additional parameter syntax
This commit is contained in:
parent
5c65cae578
commit
949c35e2a3
3 changed files with 48 additions and 7 deletions
5
Makefile
5
Makefile
|
@ -5,8 +5,8 @@ TEMPLATES := $(shell find src/ -type f)
|
|||
msg = $(if $(tprint),$(call tprint,{a.bold}==> {a.magenta}$(1){a.end}),@echo '==> $(1)')
|
||||
|
||||
|
||||
### task.mk development | args: -d -ms b_green --align center
|
||||
## bootstrap | generate local dev environment
|
||||
### task.mk development |> -d -ms b_green --align center
|
||||
## bootstrap | generate local dev environment |> -ms b_magenta -gs b_cyan
|
||||
.PHONY: bootstrap env hooks
|
||||
bootstrap: env hooks
|
||||
env:
|
||||
|
@ -17,6 +17,7 @@ hooks:
|
|||
@git config core.hooksPath .githooks
|
||||
docs-env:
|
||||
@mamba run -p ./env pip install mkdocs-material mkdocs-git-revision-date-localized-plugin
|
||||
|
||||
## l, lint | lint the python
|
||||
.PHONY: l lint
|
||||
l lint:
|
||||
|
|
25
src/help.py
25
src/help.py
|
@ -20,8 +20,31 @@ a = ansi = Ansi(target="stdout")
|
|||
MaxLens = namedtuple("MaxLens", "goal msg")
|
||||
|
||||
###- double dollar signs to prevent make escaping them -###
|
||||
###- re.X requires all important whitespace is escaped -###
|
||||
pattern = re.compile(
|
||||
r"^## (?P<goal>.*?) \| (?P<msg>.*?)(?:\s?\| args: (?P<msgargs>.*?))?$$|^### (?P<rawmsg>.*?)?(?:\s?\| args: (?P<rawargs>.*?))?$$"
|
||||
r"""
|
||||
^\#\#\
|
||||
(?P<goal>.*?)\s?\|\s?(?P<msg>.*?)
|
||||
\s?
|
||||
(?:
|
||||
(?:\|\s?args:\s?|\|>)
|
||||
\s?
|
||||
(?P<msgargs>.*?)
|
||||
)?
|
||||
$$
|
||||
|
|
||||
^\#\#\#\
|
||||
(?P<rawmsg>.*?)
|
||||
\s?
|
||||
(?:
|
||||
(?:\|\s?args:|\|\>)
|
||||
\s?
|
||||
(?P<rawargs>.*?)
|
||||
)?
|
||||
$$
|
||||
"""
|
||||
,re.X
|
||||
|
||||
)
|
||||
goal_pattern = re.compile(r"""^(?!#|\t)(.*):.*\n\t""", re.MULTILINE)
|
||||
|
||||
|
|
25
task.mk
25
task.mk
|
@ -1,7 +1,7 @@
|
|||
# }> [github.com/daylinmorgan/task.mk] <{ #
|
||||
# Copyright (c) 2022 Daylin Morgan
|
||||
# MIT License
|
||||
# version: v22.9.28-5-g83fe41d-dev
|
||||
# version: v22.9.28-7-gfa977c4-dev
|
||||
#
|
||||
# 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.
|
||||
|
@ -91,10 +91,27 @@ $(utils_py)
|
|||
a = ansi = Ansi(target="stdout")
|
||||
MaxLens = namedtuple("MaxLens", "goal msg")
|
||||
pattern = re.compile(
|
||||
r"""
|
||||
^\#\#\ (?P<goal>.*?)\ \|\ (?P<msg>.*?)(?:\s?\|\ args:\ (?P<msgargs>.*?))?$$
|
||||
r"""
|
||||
^\#\#\
|
||||
(?P<goal>.*?)\s?\|\s?(?P<msg>.*?)
|
||||
\s?
|
||||
(?:
|
||||
(?:\|\s?args:\s?|\|>)
|
||||
\s?
|
||||
(?P<msgargs>.*?)
|
||||
)?
|
||||
$$
|
||||
|
|
||||
^\#\#\#\ (?P<rawmsg>.*?)?(?:\s?\|\ args:\ (?P<rawargs>.*?))?$$"""
|
||||
^\#\#\#\
|
||||
(?P<rawmsg>.*?)
|
||||
\s?
|
||||
(?:
|
||||
(?:\|\s?args:|\|\>)
|
||||
\s?
|
||||
(?P<rawargs>.*?)
|
||||
)?
|
||||
$$
|
||||
"""
|
||||
,re.X
|
||||
)
|
||||
goal_pattern = re.compile(r"""^(?!#|\t)(.*):.*\n\t""", re.MULTILINE)
|
||||
|
|
Loading…
Reference in a new issue