Allow including or excluding properties by name only.
This commit is contained in:
11
src/pit.nim
11
src/pit.nim
@@ -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],
|
||||
|
||||
Reference in New Issue
Block a user