diff --git a/pit.nimble b/pit.nimble index d2ec177..1d7a749 100644 --- a/pit.nimble +++ b/pit.nimble @@ -1,6 +1,6 @@ # Package -version = "4.32.0" +version = "4.32.1" author = "Jonathan Bernard" description = "Personal issue tracker." license = "MIT" diff --git a/src/pit.nim b/src/pit.nim index fdf393b..2835d3c 100644 --- a/src/pit.nim +++ b/src/pit.nim @@ -253,11 +253,6 @@ when isMainModule: elif args["edit"]: for editRef in @(args[""]): - let propsOption = - if args["--properties"]: - some(parsePropertiesOption($args["--properties"])) - else: none(TableRef[string, string]) - var stateOption = none(IssueState) try: stateOption = some(parseEnum[IssueState](editRef)) @@ -267,10 +262,16 @@ when isMainModule: let state = stateOption.get ctx.loadIssues(state) for issue in ctx.issues[state]: - if propsOption.isSome: - for k,v in propsOption.get: + if propertiesOption.isSome: + for k,v in propertiesOption.get: issue[k] = v - edit(issue) + if tagsOption.isSome: + issue.tags = deduplicate(issue.tags & tagsOption.get) + if exclTagsOption.isSome: + issue.tags = issue.tags.filter( + proc (tag: string): bool = not exclTagsOption.get.anyIt(it == tag)) + if args["--non-interactive"]: issue.store() + else: edit(issue) updatedIssues.add(issue) else: @@ -278,7 +279,13 @@ when isMainModule: if propertiesOption.isSome: for k,v in propertiesOption.get: issue[k] = v - edit(issue) + if tagsOption.isSome: + issue.tags = deduplicate(issue.tags & tagsOption.get) + if exclTagsOption.isSome: + issue.tags = issue.tags.filter( + proc (tag: string): bool = not exclTagsOption.get.anyIt(it == tag)) + if args["--non-interactive"]: issue.store() + else: edit(issue) updatedIssues.add(issue) elif args["tag"]: diff --git a/src/pit/cliconstants.nim b/src/pit/cliconstants.nim index 56c6507..b65b26c 100644 --- a/src/pit/cliconstants.nim +++ b/src/pit/cliconstants.nim @@ -1,4 +1,4 @@ -const PIT_VERSION* = "4.32.0" +const PIT_VERSION* = "4.32.1" const USAGE* = """Usage: pit ( new | add) [] [options] @@ -248,4 +248,4 @@ Issue Properties: If present, expected to be a comma-delimited list of text tags. The -g option is a short-hand for '-p tags:'. -""" +""" \ No newline at end of file