Re-design output to make skimming easier.
- We now always protect the left margin when printing task details (including tags) to make it easier to skim down that line. - Also made the actual summary always follow immediately after the ID, to align to that skimmable line. - Moved the information about the delegatee to the end of the summary, next to the tags, and changed the color of the delegatee to make it easier to distinguish. - Added the `-G` option, to allow filtering out issues matching any of the provided tags. - We now allow options to be passed to both the `delegate` and `help` command. Any options are ignored, but this allows the use of tools like `cmd_shell` which always wrap commands with the pre-given options.
This commit is contained in:
@ -1,4 +1,4 @@
|
||||
const PIT_VERSION* = "4.20.0"
|
||||
const PIT_VERSION* = "4.21.0"
|
||||
|
||||
const USAGE* = """Usage:
|
||||
pit ( new | add) <summary> [<state>] [options]
|
||||
@ -9,12 +9,12 @@ const USAGE* = """Usage:
|
||||
pit tag <id>... [options]
|
||||
pit untag <id>... [options]
|
||||
pit reorder <state> [options]
|
||||
pit delegate <id> <delegated-to>
|
||||
pit delegate <id> <delegated-to> [options]
|
||||
pit hide-until <id> <date> [options]
|
||||
pit ( delete | rm ) <id>... [options]
|
||||
pit add-binary-property <id> <propName> <propSource> [options]
|
||||
pit get-binary-property <id> <propName> <propDest> [options]
|
||||
pit help
|
||||
pit help [options]
|
||||
|
||||
Options:
|
||||
|
||||
@ -38,7 +38,13 @@ Options:
|
||||
separate names. For example: -C ctx1,ctx2
|
||||
Shorthand for '-P context:<ctx>'
|
||||
|
||||
-g, --tags <tags> Specify tags for an issue.
|
||||
-g, --tags <tags> Specify tags for an issue. Tags are specified as a
|
||||
comma-delimited list. For example: -g tag1,tag2
|
||||
|
||||
-G, --excl-tags <tags> When used with the list command, exclude issues
|
||||
that contain any of the provided tags. Tags are
|
||||
specified as a comma-delimited list.
|
||||
For example: -G tag1,tag2
|
||||
|
||||
-T, --today Limit to today's issues.
|
||||
|
||||
@ -166,4 +172,4 @@ Issue Properties:
|
||||
|
||||
If present, expected to be a comma-delimited list of text tags. The -g
|
||||
option is a short-hand for '-p tags:<tags-value>'.
|
||||
"""
|
||||
"""
|
||||
|
@ -1,5 +1,6 @@
|
||||
import cliutils, docopt, json, logging, langutils, options, os,
|
||||
sequtils, strformat, strutils, tables, times, timeutils, uuids
|
||||
import std/json, std/logging, std/options, std/os, std/sequtils, std/strformat,
|
||||
std/strutils, std/tables, std/times
|
||||
import cliutils, docopt, langutils, timeutils, uuids
|
||||
|
||||
import nre except toSeq
|
||||
|
||||
@ -23,6 +24,7 @@ type
|
||||
completedRange*: Option[tuple[b, e: DateTime]]
|
||||
fullMatch*, summaryMatch*: Option[Regex]
|
||||
hasTags*: seq[string]
|
||||
exclTags*: seq[string]
|
||||
properties*: TableRef[string, string]
|
||||
exclProperties*: TableRef[string, seq[string]]
|
||||
|
||||
@ -115,6 +117,7 @@ proc initFilter*(): IssueFilter =
|
||||
fullMatch: none(Regex),
|
||||
summaryMatch: none(Regex),
|
||||
hasTags: @[],
|
||||
exclTags: @[],
|
||||
properties: newTable[string, string](),
|
||||
exclProperties: newTable[string,seq[string]]())
|
||||
|
||||
@ -372,6 +375,9 @@ proc filter*(issues: seq[Issue], filter: IssueFilter): seq[Issue] =
|
||||
for tag in filter.hasTags:
|
||||
result = result.filterIt(it.tags.find(tag) >= 0)
|
||||
|
||||
for exclTag in filter.exclTags:
|
||||
result = result.filterIt(it.tags.find(exclTag) < 0)
|
||||
|
||||
### Configuration utilities
|
||||
proc loadConfig*(args: Table[string, Value] = initTable[string, Value]()): PitConfig =
|
||||
let pitrcLocations = @[
|
||||
|
Reference in New Issue
Block a user