Compare commits
3 Commits
Author | SHA1 | Date | |
---|---|---|---|
81d326c5c8 | |||
72c332fa45 | |||
4a878026d8 |
12
ptk.nim
12
ptk.nim
@ -344,8 +344,8 @@ when isMainModule:
|
|||||||
let doc = """
|
let doc = """
|
||||||
Usage:
|
Usage:
|
||||||
ptk init [options]
|
ptk init [options]
|
||||||
ptk add [options]
|
ptk (add | start) [options]
|
||||||
ptk add [options] <summary>
|
ptk (add | start) [options] <summary>
|
||||||
ptk resume [options] [<id>]
|
ptk resume [options] [<id>]
|
||||||
ptk amend [options] [<id>] [<summary>]
|
ptk amend [options] [<id>] [<summary>]
|
||||||
ptk merge <timeline> [<timeline>...]
|
ptk merge <timeline> [<timeline>...]
|
||||||
@ -387,7 +387,7 @@ Options:
|
|||||||
let now = getLocalTime(getTime())
|
let now = getLocalTime(getTime())
|
||||||
|
|
||||||
# Parse arguments
|
# 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
|
if args["--echo-args"]: echo $args
|
||||||
|
|
||||||
@ -472,7 +472,7 @@ Options:
|
|||||||
time: if args["--time"]: parseTime($args["--time"]) else: now,
|
time: if args["--time"]: parseTime($args["--time"]) else: now,
|
||||||
summary: STOP_MSG,
|
summary: STOP_MSG,
|
||||||
notes: args["--notes"] ?: "",
|
notes: args["--notes"] ?: "",
|
||||||
tags: (args["--tags"] ?: "").split({',', ';'}))
|
tags: (args["--tags"] ?: "").split({',', ';'}).filterIt(not it.isNilOrWhitespace))
|
||||||
|
|
||||||
timeline.marks.add(newMark)
|
timeline.marks.add(newMark)
|
||||||
|
|
||||||
@ -507,14 +507,14 @@ Options:
|
|||||||
|
|
||||||
saveTimeline(timeline, timelineLocation)
|
saveTimeline(timeline, timelineLocation)
|
||||||
|
|
||||||
if args["add"]:
|
if args["add"] or args["start"]:
|
||||||
|
|
||||||
var newMark: Mark = (
|
var newMark: Mark = (
|
||||||
id: genUUID(),
|
id: genUUID(),
|
||||||
time: if args["--time"]: parseTime($args["--time"]) else: now,
|
time: if args["--time"]: parseTime($args["--time"]) else: now,
|
||||||
summary: args["<summary>"] ?: "",
|
summary: args["<summary>"] ?: "",
|
||||||
notes: args["--notes"] ?: "",
|
notes: args["--notes"] ?: "",
|
||||||
tags: (args["--tags"] ?: "").split({',', ';'}))
|
tags: (args["--tags"] ?: "").split({',', ';'}).filterIt(not it.isNilOrWhitespace))
|
||||||
|
|
||||||
if args["--edit"]: edit(newMark)
|
if args["--edit"]: edit(newMark)
|
||||||
|
|
||||||
|
@ -1,6 +1,6 @@
|
|||||||
# Package
|
# Package
|
||||||
|
|
||||||
version = "0.11.0"
|
version = "0.11.3"
|
||||||
author = "Jonathan Bernard"
|
author = "Jonathan Bernard"
|
||||||
description = "Personal Time Keeper"
|
description = "Personal Time Keeper"
|
||||||
license = "MIT"
|
license = "MIT"
|
||||||
@ -8,5 +8,5 @@ bin = @["ptk"]
|
|||||||
|
|
||||||
# Dependencies
|
# 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