mirror of
https://github.com/daylinmorgan/task.mk.git
synced 2024-12-21 17:40:45 -06:00
feat: make textwrapping for deps configurable
This commit is contained in:
parent
3defee72dc
commit
401eb1088b
3 changed files with 5 additions and 2 deletions
|
@ -7,6 +7,7 @@ MSG_STYLE ?= faint
|
|||
DIVIDER ?= ─
|
||||
DIVIDER_STYLE ?= default
|
||||
HELP_SEP ?= │
|
||||
WRAP ?= 100
|
||||
# python f-string literals
|
||||
EPILOG ?=
|
||||
USAGE ?={ansi.header}usage{ansi.end}:\n make <recipe>\n
|
||||
|
|
|
@ -13,7 +13,6 @@ from textwrap import wrap
|
|||
###-
|
||||
# this is just to trick the LSP during development
|
||||
from utils import ansi, cfg
|
||||
|
||||
# -###
|
||||
|
||||
|
||||
|
@ -92,6 +91,7 @@ def get_goal_deps(goal="task.mk"):
|
|||
if match and match.groups()[0]:
|
||||
return wrap(
|
||||
f"{ansi.style('deps','default')}: {ansi.style(match.groups()[0].strip(),'msg')}",
|
||||
width=cfg.wrap,
|
||||
initial_indent=" ",
|
||||
subsequent_indent=" ",
|
||||
)
|
||||
|
|
|
@ -12,6 +12,7 @@ class Config:
|
|||
sep: str
|
||||
epilog: str
|
||||
usage: str
|
||||
wrap: int
|
||||
|
||||
|
||||
color2byte = dict(
|
||||
|
@ -110,5 +111,6 @@ class Ansi:
|
|||
|
||||
a = ansi = Ansi()
|
||||
|
||||
cfg = Config("$(DIVIDER)", "$(HELP_SEP)", f"""$(EPILOG)""", f"""$(USAGE)""")
|
||||
cfg = Config(
|
||||
"$(DIVIDER)", "$(HELP_SEP)", f"""$(EPILOG)""", f"""$(USAGE)""",int('$(WRAP)'))
|
||||
#% endblock %#
|
||||
|
|
Loading…
Reference in a new issue