feat: add _update-task to the hidden help

This commit is contained in:
Daylin Morgan 2022-09-14 17:15:46 -05:00
parent f3050f12dc
commit de1bc7e1c9
4 changed files with 16 additions and 3 deletions

View file

@ -118,4 +118,5 @@ PRINT_VARS := VERSION
-include .task.mk -include .task.mk
.task.mk: $(TEMPLATES) generate.py .task.mk: $(TEMPLATES) generate.py
$(call tprint,{a.b_yellow}re-jinjaing the local .task.mk{a.end})
@./generate.py $(VERSION) > .task.mk || (echo "generator failed!!" && rm .task.mk) @./generate.py $(VERSION) > .task.mk || (echo "generator failed!!" && rm .task.mk)

View file

@ -19,6 +19,8 @@ vars v:
endif endif
### | args: -ws --hidden
### task.mk builtins: | args: -d --hidden
## _print-ansi | show all possible ansi color code combinations ## _print-ansi | show all possible ansi color code combinations
.PHONY: .PHONY:
_print-ansi: _print-ansi:
@ -30,8 +32,9 @@ tprint-sh = $(call pysh,info_py,$(1))
tconfirm = $(call py,confirm_py,$(1)) tconfirm = $(call py,confirm_py,$(1))
## _update-task.mk | downloads latest development version of task.mk
_update-task.mk: _update-task.mk:
$(call tprint,Updating task.mk) $(call tprint,{a.b_cyan}Updating task.mk{a.end})
curl https://raw.githubusercontent.com/daylinmorgan/task.mk/main/task.mk -o .task.mk curl https://raw.githubusercontent.com/daylinmorgan/task.mk/main/task.mk -o .task.mk
export MAKEFILE_LIST export MAKEFILE_LIST

View file

@ -25,6 +25,7 @@ def rawargs(argstring):
parser.add_argument("-d", "--divider", action="store_true") parser.add_argument("-d", "--divider", action="store_true")
parser.add_argument("-ws", "--whitespace", action="store_true") parser.add_argument("-ws", "--whitespace", action="store_true")
parser.add_argument("-ms", "--msg-style", type=str) parser.add_argument("-ms", "--msg-style", type=str)
parser.add_argument("--hidden",action="store_true")
return parser.parse_args(argstring.split()) return parser.parse_args(argstring.split())
@ -59,6 +60,8 @@ def print_goal(goal, msg, max_goal_len):
def print_rawmsg(msg, argstr, maxlens): def print_rawmsg(msg, argstr, maxlens):
args = rawargs(argstr) args = rawargs(argstr)
msg_style = args.msg_style if args.msg_style else "$(MSG_COLOR)" msg_style = args.msg_style if args.msg_style else "$(MSG_COLOR)"
if not os.getenv("SHOW_HIDDEN") and args.hidden:
return
if msg: if msg:
if args.align == "sep": if args.align == "sep":
print( print(

10
task.mk
View file

@ -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.14-2-g2e6f5d1-dev # version: v22.9.14-3-gf3050f1-dev
# #
# task.mk should be included at the bottom of your Makefile. # task.mk should be included at the bottom of your Makefile.
# 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.
@ -46,6 +46,8 @@ vars v:
endif endif
### | args: -ws --hidden
### task.mk builtins: | args: -d --hidden
## _print-ansi | show all possible ansi color code combinations ## _print-ansi | show all possible ansi color code combinations
.PHONY: .PHONY:
_print-ansi: _print-ansi:
@ -57,8 +59,9 @@ tprint-sh = $(call pysh,info_py,$(1))
tconfirm = $(call py,confirm_py,$(1)) tconfirm = $(call py,confirm_py,$(1))
## _update-task.mk | downloads latest development version of task.mk
_update-task.mk: _update-task.mk:
$(call tprint,Updating task.mk) $(call tprint,{a.b_cyan}Updating task.mk{a.end})
curl https://raw.githubusercontent.com/daylinmorgan/task.mk/main/task.mk -o .task.mk curl https://raw.githubusercontent.com/daylinmorgan/task.mk/main/task.mk -o .task.mk
export MAKEFILE_LIST export MAKEFILE_LIST
@ -121,6 +124,7 @@ def rawargs(argstring):
parser.add_argument("-d", "--divider", action="store_true") parser.add_argument("-d", "--divider", action="store_true")
parser.add_argument("-ws", "--whitespace", action="store_true") parser.add_argument("-ws", "--whitespace", action="store_true")
parser.add_argument("-ms", "--msg-style", type=str) parser.add_argument("-ms", "--msg-style", type=str)
parser.add_argument("--hidden",action="store_true")
return parser.parse_args(argstring.split()) return parser.parse_args(argstring.split())
@ -155,6 +159,8 @@ def print_goal(goal, msg, max_goal_len):
def print_rawmsg(msg, argstr, maxlens): def print_rawmsg(msg, argstr, maxlens):
args = rawargs(argstr) args = rawargs(argstr)
msg_style = args.msg_style if args.msg_style else "$(MSG_COLOR)" msg_style = args.msg_style if args.msg_style else "$(MSG_COLOR)"
if not os.getenv("SHOW_HIDDEN") and args.hidden:
return
if msg: if msg:
if args.align == "sep": if args.align == "sep":
print( print(