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 # Package
version = "4.27.0" version = "4.26.0"
author = "Jonathan Bernard" author = "Jonathan Bernard"
description = "Personal issue tracker." description = "Personal issue tracker."
license = "MIT" license = "MIT"

View File

@ -253,8 +253,7 @@ proc list(
ctx: CliContext, ctx: CliContext,
filter: Option[IssueFilter], filter: Option[IssueFilter],
states: Option[seq[IssueState]], states: Option[seq[IssueState]],
showToday = false, showToday, showFuture,
showFuture = false,
showHidden = false, showHidden = false,
verbose: bool) = verbose: bool) =
@ -428,11 +427,6 @@ when isMainModule:
elif args["edit"]: elif args["edit"]:
for editRef in @(args["<ref>"]): for editRef in @(args["<ref>"]):
let propsOption =
if args["--properties"]:
some(parsePropertiesOption($args["--properties"]))
else: none(TableRef[string, string])
var stateOption = none(IssueState) var stateOption = none(IssueState)
try: stateOption = some(parseEnum[IssueState](editRef)) try: stateOption = some(parseEnum[IssueState](editRef))
@ -441,18 +435,9 @@ when isMainModule:
if stateOption.isSome: if stateOption.isSome:
let state = stateOption.get let state = stateOption.get
ctx.loadIssues(state) ctx.loadIssues(state)
for issue in ctx.issues[state]: for issue in ctx.issues[state]: edit(issue)
if propsOption.isSome:
for k,v in propsOption.get:
issue[k] = v
edit(issue)
else: else: edit(ctx.cfg.tasksDir.loadIssueById(editRef))
let issue = ctx.cfg.tasksDir.loadIssueById(editRef)
if propertiesOption.isSome:
for k,v in propertiesOption.get:
issue[k] = v
edit(issue)
elif args["tag"]: elif args["tag"]:
if tagsOption.isNone: raise newException(Exception, "no tags given") if tagsOption.isNone: raise newException(Exception, "no tags given")
@ -593,12 +578,10 @@ when isMainModule:
filter.exclProperties.del("context") filter.exclProperties.del("context")
var listContexts = false var listContexts = false
var listTags = false
var statesOption = none(seq[IssueState]) var statesOption = none(seq[IssueState])
var issueIdsOption = none(seq[string]) var issueIdsOption = none(seq[string])
if args["contexts"]: listContexts = true if args["contexts"]: listContexts = true
elif args["tags"]: listTags = true
elif args["<stateOrId>"]: elif args["<stateOrId>"]:
try: try:
statesOption = statesOption =
@ -624,21 +607,6 @@ when isMainModule:
for c in uniqContexts.sorted: for c in uniqContexts.sorted:
stdout.writeLine(c.alignLeft(maxLen+2) & ctx.getIssueContextDisplayName(c)) 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 # List a specific issue
elif issueIdsOption.isSome: elif issueIdsOption.isSome:
for issueId in issueIdsOption.get: 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: const USAGE* = """Usage:
pit ( new | add) <summary> [<state>] [options] pit ( new | add) <summary> [<state>] [options]
pit list contexts [options] pit list contexts [options]
pit list tags [options]
pit list [<stateOrId>...] [options] pit list [<stateOrId>...] [options]
pit ( start | done | pending | todo-today | todo | suspend ) <id>... [options] pit ( start | done | pending | todo-today | todo | suspend ) <id>... [options]
pit edit <ref>... [options] pit edit <ref>... [options]