Allow including or excluding properties by name only.

This commit is contained in:
2025-12-01 14:04:19 -06:00
parent 1d18be9d1b
commit 3d1dc7512a
3 changed files with 22 additions and 8 deletions

View File

@@ -19,18 +19,16 @@ proc parsePropertiesOption(propsOpt: string): TableRef[string, string] =
result = newTable[string, string]()
for propText in propsOpt.split(";"):
let pair = propText.split(":", 1)
if pair.len == 1: result[pair[0]] = "true"
if pair.len == 1: result[pair[0]] = MATCH_ANY
else: result[pair[0]] = pair[1]
proc parseExclPropertiesOption(propsOpt: string): TableRef[string, seq[string]] =
result = newTable[string, seq[string]]()
for propText in propsOpt.split(";"):
let pair = propText.split(":", 1)
let val =
if pair.len == 1: "true"
else: pair[1]
if result.hasKey(pair[0]): result[pair[0]].add(val)
else: result[pair[0]] = @[val]
if not result.hasKey(pair[0]): result[pair[0]] = @[]
if pair.len == 2: result[pair[0]].add(pair[1])
proc reorder(ctx: CliContext, state: IssueState) =
@@ -39,6 +37,7 @@ proc reorder(ctx: CliContext, state: IssueState) =
ctx.loadIssues(state)
discard os.execShellCmd(EDITOR & " '" & (ctx.cfg.tasksDir / $state / "order.txt") & "' </dev/tty >/dev/tty")
proc addIssue(
ctx: CliContext,
args: Table[string, Value],