mirror of
https://github.com/daylinmorgan/task.mk.git
synced 2024-12-21 17:40:45 -06:00
refactor: only accept known args
This commit is contained in:
parent
5eb3e21b51
commit
ea398af49a
3 changed files with 7 additions and 8 deletions
1
Makefile
1
Makefile
|
@ -6,7 +6,6 @@ msgfmt = {a.style('==>','bold')} {a.style('$(1)','b_magenta')} {a.style('<==','b
|
|||
msg = $(call tprint,$(call msgfmt ,$(1)))
|
||||
|
||||
### task.mk development | args: --divider --align center
|
||||
|
||||
## bootstrap | generate local dev environment
|
||||
.PHONY: bootstrap
|
||||
bootstrap:
|
||||
|
|
|
@ -21,10 +21,10 @@ pattern = re.compile(
|
|||
|
||||
def rawargs(argstring):
|
||||
parser = argparse.ArgumentParser()
|
||||
parser.add_argument("-a", "--align")
|
||||
parser.add_argument("--align")
|
||||
parser.add_argument("-d", "--divider", action="store_true")
|
||||
parser.add_argument("-ws", "--whitespace", action="store_true")
|
||||
return parser.parse_known_args(argstring.split())
|
||||
return parser.parse_args(argstring.split())
|
||||
|
||||
|
||||
def gen_makefile():
|
||||
|
@ -56,7 +56,7 @@ def print_goal(goal, msg, max_goal_len):
|
|||
|
||||
|
||||
def print_rawmsg(msg, argstr, maxlens):
|
||||
args, unknown = rawargs(argstr)
|
||||
args = rawargs(argstr)
|
||||
if msg:
|
||||
if args.align == "sep":
|
||||
print(
|
||||
|
|
8
task.mk
8
task.mk
|
@ -1,7 +1,7 @@
|
|||
# }> [github.com/daylinmorgan/task.mk] <{ #
|
||||
# Copyright (c) 2022 Daylin Morgan
|
||||
# MIT License
|
||||
# version: v22.9.12-6-gf9cb3f6-dev
|
||||
# version: v22.9.12-7-g5eb3e21-dev
|
||||
#
|
||||
# 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.
|
||||
|
@ -116,10 +116,10 @@ pattern = re.compile(
|
|||
|
||||
def rawargs(argstring):
|
||||
parser = argparse.ArgumentParser()
|
||||
parser.add_argument("-a", "--align")
|
||||
parser.add_argument("--align")
|
||||
parser.add_argument("-d", "--divider", action="store_true")
|
||||
parser.add_argument("-ws", "--whitespace", action="store_true")
|
||||
return parser.parse_known_args(argstring.split())
|
||||
return parser.parse_args(argstring.split())
|
||||
|
||||
|
||||
def gen_makefile():
|
||||
|
@ -151,7 +151,7 @@ def print_goal(goal, msg, max_goal_len):
|
|||
|
||||
|
||||
def print_rawmsg(msg, argstr, maxlens):
|
||||
args, unknown = rawargs(argstr)
|
||||
args = rawargs(argstr)
|
||||
if msg:
|
||||
if args.align == "sep":
|
||||
print(
|
||||
|
|
Loading…
Reference in a new issue