Compare commits
3 Commits
Author | SHA1 | Date | |
---|---|---|---|
5140afa671 | |||
56be47f7e1 | |||
75f74c3a0a |
12
ptk.nim
12
ptk.nim
@ -357,7 +357,7 @@ proc filterMarkIndices(timeline: Timeline, args: Table[string, Value]): seq[int]
|
||||
selected = selected.filterMarks(not tags.allIt(marks[mIdx].tags.contains(it)))
|
||||
|
||||
if args["--matching"]:
|
||||
let pattern = re(args["--matching"] ?: "")
|
||||
let pattern = re("(?i)" & $(args["--matching"] ?: ""))
|
||||
selected = selected.filterMarks(marks[mIdx].summary.find(pattern).isSome)
|
||||
|
||||
return sequtils.toSeq(selected.items).sorted(system.cmp)
|
||||
@ -413,7 +413,7 @@ Options:
|
||||
let now = getTime().local
|
||||
|
||||
# Parse arguments
|
||||
let args = docopt(doc, version = "ptk 0.12.0")
|
||||
let args = docopt(doc, version = "ptk 0.12.3")
|
||||
|
||||
if args["--echo-args"]: echo $args
|
||||
|
||||
@ -493,6 +493,10 @@ Options:
|
||||
|
||||
if args["stop"]:
|
||||
|
||||
if timeline.marks.last.summary == STOP_MSG:
|
||||
echo "ptk: no current task, nothing to stop"
|
||||
quit(0)
|
||||
|
||||
let newMark: Mark = (
|
||||
id: genUUID(),
|
||||
time: if args["--time"]: parseTime($args["--time"]) else: now,
|
||||
@ -505,14 +509,14 @@ Options:
|
||||
timeline.writeMarks(
|
||||
indices = @[timeline.marks.len - 2],
|
||||
includeNotes = args["--verbose"])
|
||||
echo "stopped timer"
|
||||
echo "ptk: stopped timer"
|
||||
|
||||
saveTimeline(timeline, timelineLocation)
|
||||
|
||||
if args["continue"]:
|
||||
|
||||
if timeline.marks.last.summary != STOP_MSG:
|
||||
echo "There is already something in progress:"
|
||||
echo "ptk: there is already something in progress:"
|
||||
timeline.writeMarks(
|
||||
indices = @[timeline.marks.len - 1],
|
||||
includeNotes = args["--verbose"])
|
||||
|
@ -1,6 +1,6 @@
|
||||
# Package
|
||||
|
||||
version = "0.12.0"
|
||||
version = "0.12.3"
|
||||
author = "Jonathan Bernard"
|
||||
description = "Personal Time Keeper"
|
||||
license = "MIT"
|
||||
|
Reference in New Issue
Block a user