3 Commits

2 changed files with 8 additions and 8 deletions

12
ptk.nim
View File

@ -344,8 +344,8 @@ when isMainModule:
let doc = """
Usage:
ptk init [options]
ptk add [options]
ptk add [options] <summary>
ptk (add | start) [options]
ptk (add | start) [options] <summary>
ptk resume [options] [<id>]
ptk amend [options] [<id>] [<summary>]
ptk merge <timeline> [<timeline>...]
@ -387,7 +387,7 @@ Options:
let now = getLocalTime(getTime())
# Parse arguments
let args = docopt(doc, version = "ptk 0.11.0")
let args = docopt(doc, version = "ptk 0.11.3")
if args["--echo-args"]: echo $args
@ -472,7 +472,7 @@ Options:
time: if args["--time"]: parseTime($args["--time"]) else: now,
summary: STOP_MSG,
notes: args["--notes"] ?: "",
tags: (args["--tags"] ?: "").split({',', ';'}))
tags: (args["--tags"] ?: "").split({',', ';'}).filterIt(not it.isNilOrWhitespace))
timeline.marks.add(newMark)
@ -507,14 +507,14 @@ Options:
saveTimeline(timeline, timelineLocation)
if args["add"]:
if args["add"] or args["start"]:
var newMark: Mark = (
id: genUUID(),
time: if args["--time"]: parseTime($args["--time"]) else: now,
summary: args["<summary>"] ?: "",
notes: args["--notes"] ?: "",
tags: (args["--tags"] ?: "").split({',', ';'}))
tags: (args["--tags"] ?: "").split({',', ';'}).filterIt(not it.isNilOrWhitespace))
if args["--edit"]: edit(newMark)

View File

@ -1,6 +1,6 @@
# Package
version = "0.11.0"
version = "0.11.3"
author = "Jonathan Bernard"
description = "Personal Time Keeper"
license = "MIT"
@ -8,5 +8,5 @@ bin = @["ptk"]
# Dependencies
requires @["nim >= 0.15.0", "docopt >= 0.6.4", "uuids", "langutils", "tempfile", "timeutils >= 0.2.0", "isaac >= 0.1.2"]
requires @["nim >= 0.18.0", "docopt >= 0.6.4", "uuids", "langutils", "tempfile", "timeutils >= 0.2.2", "isaac >= 0.1.2"]