Compare commits
3 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
| e35bd9f85a | |||
| 3d8fafd7b2 | |||
| 7d5d55d24a |
@@ -1,6 +1,6 @@
|
|||||||
# Package
|
# Package
|
||||||
|
|
||||||
version = "4.31.2"
|
version = "4.33.0"
|
||||||
author = "Jonathan Bernard"
|
author = "Jonathan Bernard"
|
||||||
description = "Personal issue tracker."
|
description = "Personal issue tracker."
|
||||||
license = "MIT"
|
license = "MIT"
|
||||||
|
|||||||
36
src/pit.nim
36
src/pit.nim
@@ -253,11 +253,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))
|
||||||
@@ -267,10 +262,16 @@ when isMainModule:
|
|||||||
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]:
|
||||||
if propsOption.isSome:
|
if propertiesOption.isSome:
|
||||||
for k,v in propsOption.get:
|
for k,v in propertiesOption.get:
|
||||||
issue[k] = v
|
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)
|
updatedIssues.add(issue)
|
||||||
|
|
||||||
else:
|
else:
|
||||||
@@ -278,7 +279,13 @@ when isMainModule:
|
|||||||
if propertiesOption.isSome:
|
if propertiesOption.isSome:
|
||||||
for k,v in propertiesOption.get:
|
for k,v in propertiesOption.get:
|
||||||
issue[k] = v
|
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)
|
updatedIssues.add(issue)
|
||||||
|
|
||||||
elif args["tag"]:
|
elif args["tag"]:
|
||||||
@@ -306,6 +313,17 @@ when isMainModule:
|
|||||||
issue.store()
|
issue.store()
|
||||||
updatedIssues.add(issue)
|
updatedIssues.add(issue)
|
||||||
|
|
||||||
|
elif args["update-details"]:
|
||||||
|
let details =
|
||||||
|
if not args["--file"] or $args["--file"] == "-": readAll(stdin)
|
||||||
|
else: readFile($args["--file"])
|
||||||
|
|
||||||
|
for id in @(args["<id>"]):
|
||||||
|
var issue = ctx.cfg.tasksDir.loadIssueById(id)
|
||||||
|
issue.details = details
|
||||||
|
issue.store()
|
||||||
|
updatedIssues.add(issue)
|
||||||
|
|
||||||
elif args["start"] or args["todo-today"] or args["done"] or
|
elif args["start"] or args["todo-today"] or args["done"] or
|
||||||
args["pending"] or args["todo"] or args["suspend"]:
|
args["pending"] or args["todo"] or args["suspend"]:
|
||||||
|
|
||||||
|
|||||||
@@ -1,4 +1,4 @@
|
|||||||
const PIT_VERSION* = "4.31.2"
|
const PIT_VERSION* = "4.33.0"
|
||||||
|
|
||||||
const USAGE* = """Usage:
|
const USAGE* = """Usage:
|
||||||
pit ( new | add) <summary> [<state>] [options]
|
pit ( new | add) <summary> [<state>] [options]
|
||||||
@@ -10,6 +10,7 @@ const USAGE* = """Usage:
|
|||||||
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]
|
||||||
pit tag <id>... [options]
|
pit tag <id>... [options]
|
||||||
|
pit update-details <id> [--file=<path>] [options]
|
||||||
pit untag <id>... [options]
|
pit untag <id>... [options]
|
||||||
pit reorder <state> [options]
|
pit reorder <state> [options]
|
||||||
pit delegate <id> <delegated-to> [options]
|
pit delegate <id> <delegated-to> [options]
|
||||||
|
|||||||
@@ -230,7 +230,9 @@ proc fromStorageFormat*(id: string, issueTxt: string): Issue =
|
|||||||
var detailLines: seq[string] = @[]
|
var detailLines: seq[string] = @[]
|
||||||
|
|
||||||
for line in issueTxt.splitLines():
|
for line in issueTxt.splitLines():
|
||||||
if line.startsWith("#"): continue # ignore lines starting with '#'
|
if line.startsWith("#") and parseState != ReadingDetails:
|
||||||
|
# ignore lines starting with '#', unless we're in the details section.
|
||||||
|
continue
|
||||||
|
|
||||||
case parseState
|
case parseState
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user