Add created property when creating issues.
This commit is contained in:
parent
efd5f6adff
commit
6f247032a3
@ -1,6 +1,6 @@
|
|||||||
# Package
|
# Package
|
||||||
|
|
||||||
version = "4.0.6"
|
version = "4.0.7"
|
||||||
author = "Jonathan Bernard"
|
author = "Jonathan Bernard"
|
||||||
description = "Personal issue tracker."
|
description = "Personal issue tracker."
|
||||||
license = "MIT"
|
license = "MIT"
|
||||||
|
@ -3,7 +3,7 @@
|
|||||||
##
|
##
|
||||||
|
|
||||||
import cliutils, docopt, json, logging, options, os, ospaths, sequtils,
|
import cliutils, docopt, json, logging, options, os, ospaths, sequtils,
|
||||||
tables, terminal, times, unicode, uuids
|
tables, terminal, times, timeutils, unicode, uuids
|
||||||
|
|
||||||
import strutils except capitalize, toUpper, toLower
|
import strutils except capitalize, toUpper, toLower
|
||||||
import pitpkg/private/libpit
|
import pitpkg/private/libpit
|
||||||
@ -266,7 +266,7 @@ Options:
|
|||||||
logging.addHandler(newConsoleLogger())
|
logging.addHandler(newConsoleLogger())
|
||||||
|
|
||||||
# Parse arguments
|
# Parse arguments
|
||||||
let args = docopt(doc, version = "pit 4.0.6")
|
let args = docopt(doc, version = "pit 4.0.7")
|
||||||
|
|
||||||
if args["--echo-args"]: stderr.writeLine($args)
|
if args["--echo-args"]: stderr.writeLine($args)
|
||||||
|
|
||||||
@ -298,10 +298,13 @@ Options:
|
|||||||
if args["<state>"]: parseEnum[IssueState]($args["<state>"])
|
if args["<state>"]: parseEnum[IssueState]($args["<state>"])
|
||||||
else: TodoToday
|
else: TodoToday
|
||||||
|
|
||||||
|
var issueProps = propertiesOption.get(newTable[string,string]())
|
||||||
|
if not issueProps.hasKey("created"): issueProps["created"] = getTime().local.formatIso8601
|
||||||
|
|
||||||
var issue = Issue(
|
var issue = Issue(
|
||||||
id: genUUID(),
|
id: genUUID(),
|
||||||
summary: $args["<summary>"],
|
summary: $args["<summary>"],
|
||||||
properties: propertiesOption.get(newTable[string,string]()),
|
properties: issueProps,
|
||||||
tags:
|
tags:
|
||||||
if args["--tags"]: ($args["tags"]).split(",").mapIt(it.strip)
|
if args["--tags"]: ($args["tags"]).split(",").mapIt(it.strip)
|
||||||
else: newSeq[string]())
|
else: newSeq[string]())
|
||||||
|
Loading…
x
Reference in New Issue
Block a user