Format listed issues plainly when STDOUT is not a TTY

This commit is contained in:
Jonathan Bernard 2024-01-01 12:55:01 -06:00
parent d04797460c
commit be7c099b7b
3 changed files with 5 additions and 5 deletions

View File

@ -1,6 +1,6 @@
# Package # Package
version = "4.25.0" version = "4.25.1"
author = "Jonathan Bernard" author = "Jonathan Bernard"
description = "Personal issue tracker." description = "Personal issue tracker."
license = "MIT" license = "MIT"

View File

@ -269,7 +269,7 @@ proc list(
it.hasProp("completed") and it.hasProp("completed") and
sameDay(getTime().local, it.getDateTime("completed"))) sameDay(getTime().local, it.getDateTime("completed")))
if isatty(stdin): if isatty(stdout):
stdout.write ctx.formatSection(ctx.issues[state], state, "", verbose) stdout.write ctx.formatSection(ctx.issues[state], state, "", verbose)
else: else:
@ -305,7 +305,7 @@ proc list(
not (it.hasProp("hide-until") and not (it.hasProp("hide-until") and
it.getDateTime("hide-until") > getTime().local)) it.getDateTime("hide-until") > getTime().local))
if isatty(stdin): if isatty(stdout):
stdout.write ctx.formatSection(visibleIssues, s, indent, verbose) stdout.write ctx.formatSection(visibleIssues, s, indent, verbose)
else: else:
@ -328,7 +328,7 @@ proc list(
not (it.hasProp("hide-until") and not (it.hasProp("hide-until") and
it.getDateTime("hide-until") > getTime().local)) it.getDateTime("hide-until") > getTime().local))
if isatty(stdin): if isatty(stdout):
stdout.write ctx.formatSection(visibleIssues, s, indent, verbose) stdout.write ctx.formatSection(visibleIssues, s, indent, verbose)
else: else:

View File

@ -1,4 +1,4 @@
const PIT_VERSION* = "4.25.0" const PIT_VERSION* = "4.25.1"
const USAGE* = """Usage: const USAGE* = """Usage:
pit ( new | add) <summary> [<state>] [options] pit ( new | add) <summary> [<state>] [options]