Add --show-hidden to ignore hide-until properties.
This commit is contained in:
parent
df854f864c
commit
71e035fdbe
@ -1,6 +1,6 @@
|
||||
# Package
|
||||
|
||||
version = "4.17.0"
|
||||
version = "4.18.0"
|
||||
author = "Jonathan Bernard"
|
||||
description = "Personal issue tracker."
|
||||
license = "MIT"
|
||||
|
26
src/pit.nim
26
src/pit.nim
@ -200,7 +200,13 @@ proc edit(issue: Issue) =
|
||||
getCurrentExceptionMsg()
|
||||
issue.store()
|
||||
|
||||
proc list(ctx: CliContext, filter: Option[IssueFilter], states: Option[seq[IssueState]], showToday, showFuture, verbose: bool) =
|
||||
proc list(
|
||||
ctx: CliContext,
|
||||
filter: Option[IssueFilter],
|
||||
states: Option[seq[IssueState]],
|
||||
showToday, showFuture,
|
||||
showHidden = false,
|
||||
verbose: bool) =
|
||||
|
||||
if states.isSome:
|
||||
trace "listing issues for " & $states.get
|
||||
@ -237,7 +243,12 @@ proc list(ctx: CliContext, filter: Option[IssueFilter], states: Option[seq[Issue
|
||||
|
||||
for s in [Current, TodoToday, Pending]:
|
||||
if ctx.issues.hasKey(s) and ctx.issues[s].len > 0:
|
||||
stdout.write ctx.formatSection(ctx.issues[s], s, indent, verbose)
|
||||
let visibleIssues = ctx.issues[s].filterIt(
|
||||
showHidden or
|
||||
not (it.hasProp("hide-until") and
|
||||
it.getDateTime("hide-until") > getTime().local))
|
||||
|
||||
stdout.write ctx.formatSection(visibleIssues, s, indent, verbose)
|
||||
|
||||
# Future items
|
||||
if future:
|
||||
@ -246,6 +257,7 @@ proc list(ctx: CliContext, filter: Option[IssueFilter], states: Option[seq[Issue
|
||||
for s in [Pending, Todo]:
|
||||
if ctx.issues.hasKey(s) and ctx.issues[s].len > 0:
|
||||
let visibleIssues = ctx.issues[s].filterIt(
|
||||
showHidden or
|
||||
not (it.hasProp("hide-until") and
|
||||
it.getDateTime("hide-until") > getTime().local))
|
||||
|
||||
@ -501,9 +513,13 @@ when isMainModule:
|
||||
else:
|
||||
trace "listing all issues"
|
||||
let showBoth = args["--today"] == args["--future"]
|
||||
ctx.list(filterOption, statesOption, showBoth or args["--today"],
|
||||
showBoth or args["--future"],
|
||||
ctx.verbose)
|
||||
ctx.list(
|
||||
filter = filterOption,
|
||||
states = statesOption,
|
||||
showToday = showBoth or args["--today"],
|
||||
showFuture = showBoth or args["--future"],
|
||||
showHidden = args["--show-hidden"],
|
||||
verbose = ctx.verbose)
|
||||
|
||||
elif args["add-binary-property"]:
|
||||
let issue = ctx.tasksDir.loadIssueById($(args["<id>"]))
|
||||
|
@ -40,10 +40,10 @@ template checkAuth(cfg: PitApiCfg) =
|
||||
var authed {.inject.} = false
|
||||
|
||||
try:
|
||||
if not request.headers.hasKey("Authorization"):
|
||||
if not headers(request).hasKey("Authorization"):
|
||||
raiseEx "No auth token."
|
||||
|
||||
let headerVal = request.headers["Authorization"]
|
||||
let headerVal = headers(request)["Authorization"]
|
||||
if not headerVal.startsWith("Bearer "):
|
||||
raiseEx "Invalid Authentication type (only 'Bearer' is supported)."
|
||||
|
||||
|
@ -1 +1 @@
|
||||
const PIT_VERSION* = "4.17.0"
|
||||
const PIT_VERSION* = "4.18.0"
|
@ -31,6 +31,9 @@ Options:
|
||||
|
||||
-F, --future Limit to future issues.
|
||||
|
||||
-H, --show-hidden Show all matching issues, ignoring any 'hide-until'
|
||||
properties set.
|
||||
|
||||
-m, --match <pattern> Limit to issues whose summaries match the given
|
||||
pattern (PCRE regex supported).
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user