Compare commits

..

No commits in common. "e955cd5b2438822d3ddb1a175ec3756f8ac83a5b" and "587e3c4509bdd18755530fe7bef36b9c95070d0b" have entirely different histories.

5 changed files with 6 additions and 40 deletions

View File

@ -1,2 +0,0 @@
[tools]
nim = "2.2.0"

1
.tool-versions Normal file
View File

@ -0,0 +1 @@
nim 2.2.0

View File

@ -1,6 +1,6 @@
# Package
version = "4.27.0"
version = "4.26.0"
author = "Jonathan Bernard"
description = "Personal issue tracker."
license = "MIT"

View File

@ -253,8 +253,7 @@ proc list(
ctx: CliContext,
filter: Option[IssueFilter],
states: Option[seq[IssueState]],
showToday = false,
showFuture = false,
showToday, showFuture,
showHidden = false,
verbose: bool) =
@ -428,11 +427,6 @@ when isMainModule:
elif args["edit"]:
for editRef in @(args["<ref>"]):
let propsOption =
if args["--properties"]:
some(parsePropertiesOption($args["--properties"]))
else: none(TableRef[string, string])
var stateOption = none(IssueState)
try: stateOption = some(parseEnum[IssueState](editRef))
@ -441,18 +435,9 @@ when isMainModule:
if stateOption.isSome:
let state = stateOption.get
ctx.loadIssues(state)
for issue in ctx.issues[state]:
if propsOption.isSome:
for k,v in propsOption.get:
issue[k] = v
edit(issue)
for issue in ctx.issues[state]: edit(issue)
else:
let issue = ctx.cfg.tasksDir.loadIssueById(editRef)
if propertiesOption.isSome:
for k,v in propertiesOption.get:
issue[k] = v
edit(issue)
else: edit(ctx.cfg.tasksDir.loadIssueById(editRef))
elif args["tag"]:
if tagsOption.isNone: raise newException(Exception, "no tags given")
@ -593,12 +578,10 @@ when isMainModule:
filter.exclProperties.del("context")
var listContexts = false
var listTags = false
var statesOption = none(seq[IssueState])
var issueIdsOption = none(seq[string])
if args["contexts"]: listContexts = true
elif args["tags"]: listTags = true
elif args["<stateOrId>"]:
try:
statesOption =
@ -624,21 +607,6 @@ when isMainModule:
for c in uniqContexts.sorted:
stdout.writeLine(c.alignLeft(maxLen+2) & ctx.getIssueContextDisplayName(c))
elif listTags:
var uniqTags = newseq[string]()
if statesOption.isSome:
for state in statesOption.get: ctx.loadIssues(state)
else: ctx.loadAllIssues()
if filterOption.isSome: ctx.filterIssues(filterOption.get)
for state, issueList in ctx.issues:
for issue in issueList:
for tag in issue.tags:
if not uniqTags.contains(tag): uniqTags.add(tag)
stdout.writeLine(uniqTags.sorted.join("\n"))
# List a specific issue
elif issueIdsOption.isSome:
for issueId in issueIdsOption.get:

View File

@ -1,9 +1,8 @@
const PIT_VERSION* = "4.27.0"
const PIT_VERSION* = "4.26.0"
const USAGE* = """Usage:
pit ( new | add) <summary> [<state>] [options]
pit list contexts [options]
pit list tags [options]
pit list [<stateOrId>...] [options]
pit ( start | done | pending | todo-today | todo | suspend ) <id>... [options]
pit edit <ref>... [options]