Compare commits
3 Commits
Author | SHA1 | Date | |
---|---|---|---|
81d326c5c8 | |||
72c332fa45 | |||
4a878026d8 |
12
ptk.nim
12
ptk.nim
@ -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)
|
||||
|
||||
|
@ -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"]
|
||||
|
||||
|
Reference in New Issue
Block a user