2 Commits

2 changed files with 8 additions and 4 deletions

10
ptk.nim
View File

@ -413,7 +413,7 @@ Options:
let now = getTime().local let now = getTime().local
# Parse arguments # Parse arguments
let args = docopt(doc, version = "ptk 0.12.1") let args = docopt(doc, version = "ptk 0.12.3")
if args["--echo-args"]: echo $args if args["--echo-args"]: echo $args
@ -493,6 +493,10 @@ Options:
if args["stop"]: if args["stop"]:
if timeline.marks.last.summary == STOP_MSG:
echo "ptk: no current task, nothing to stop"
quit(0)
let newMark: Mark = ( let newMark: Mark = (
id: genUUID(), id: genUUID(),
time: if args["--time"]: parseTime($args["--time"]) else: now, time: if args["--time"]: parseTime($args["--time"]) else: now,
@ -505,14 +509,14 @@ Options:
timeline.writeMarks( timeline.writeMarks(
indices = @[timeline.marks.len - 2], indices = @[timeline.marks.len - 2],
includeNotes = args["--verbose"]) includeNotes = args["--verbose"])
echo "stopped timer" echo "ptk: stopped timer"
saveTimeline(timeline, timelineLocation) saveTimeline(timeline, timelineLocation)
if args["continue"]: if args["continue"]:
if timeline.marks.last.summary != STOP_MSG: if timeline.marks.last.summary != STOP_MSG:
echo "There is already something in progress:" echo "ptk: there is already something in progress:"
timeline.writeMarks( timeline.writeMarks(
indices = @[timeline.marks.len - 1], indices = @[timeline.marks.len - 1],
includeNotes = args["--verbose"]) includeNotes = args["--verbose"])

View File

@ -1,6 +1,6 @@
# Package # Package
version = "0.12.1" version = "0.12.3"
author = "Jonathan Bernard" author = "Jonathan Bernard"
description = "Personal Time Keeper" description = "Personal Time Keeper"
license = "MIT" license = "MIT"