PIT CLI agenda sorting, FileIssue bug fixed.
* Fixed the bug in FileIssue where it would append a blank line to the body of an issue every time it wrote the issue to the file. Fixed by making the parser consume a line break before the property section. * Fixed PIT CLI -D option sorting of issues so that it will sort issues by priority, then due date.
This commit is contained in:
parent
0441f3c510
commit
85753de955
@ -1,11 +1,11 @@
|
|||||||
#Mon, 19 Dec 2011 16:07:10 -0600
|
#Mon, 19 Dec 2011 16:21:52 -0600
|
||||||
#Sat Apr 24 17:08:00 CDT 2010
|
#Sat Apr 24 17:08:00 CDT 2010
|
||||||
build.dir=build
|
build.dir=build
|
||||||
src.dir=src
|
src.dir=src
|
||||||
lib.shared.dir=../shared-libs
|
lib.shared.dir=../shared-libs
|
||||||
test.dir=test
|
test.dir=test
|
||||||
build.number=3
|
build.number=1
|
||||||
version=3.3.0
|
version=3.3.1
|
||||||
name=libpit
|
name=libpit
|
||||||
lib.dir=lib
|
lib.dir=lib
|
||||||
lib.local=true
|
lib.local=true
|
||||||
|
@ -27,8 +27,8 @@ public class IssuePegParser extends BaseParser<Object> {
|
|||||||
|
|
||||||
Rule PropertyBlock() {
|
Rule PropertyBlock() {
|
||||||
return Sequence(push(makeNode()),
|
return Sequence(push(makeNode()),
|
||||||
HorizontalRule(), OneOrMore(EOL), TableSeparator(), EOL,
|
EOL, HorizontalRule(), OneOrMore(EOL), TableSeparator(),
|
||||||
OneOrMore(PropertyDefinition()), TableSeparator(),
|
EOL, OneOrMore(PropertyDefinition()), TableSeparator(),
|
||||||
addToNode("extProperties", pop())); }
|
addToNode("extProperties", pop())); }
|
||||||
|
|
||||||
Rule PropertyDefinition() {
|
Rule PropertyDefinition() {
|
||||||
|
@ -1,9 +1,9 @@
|
|||||||
#Mon, 19 Dec 2011 16:07:16 -0600
|
#Mon, 19 Dec 2011 16:24:43 -0600
|
||||||
build.dir=build
|
build.dir=build
|
||||||
src.dir=src
|
src.dir=src
|
||||||
build.jar=pit-cli-${application.version}.${build.number}.jar
|
build.jar=pit-cli-${application.version}.${build.number}.jar
|
||||||
build.number=3
|
build.number=2
|
||||||
version=3.3.0
|
version=3.3.1
|
||||||
name=pit-cli
|
name=pit-cli
|
||||||
lib.dir=lib
|
lib.dir=lib
|
||||||
lib.local=true
|
lib.local=true
|
||||||
|
@ -83,7 +83,7 @@ cli._(longOpt: 'version', 'Display PIT version information.')
|
|||||||
// ======== Parse CLI Options ======== //
|
// ======== Parse CLI Options ======== //
|
||||||
// =================================== //
|
// =================================== //
|
||||||
|
|
||||||
def VERSION = "3.3.0"
|
def VERSION = "3.3.1"
|
||||||
def opts = cli.parse(args)
|
def opts = cli.parse(args)
|
||||||
def issuedb = [:]
|
def issuedb = [:]
|
||||||
def workingDir = new File('.')
|
def workingDir = new File('.')
|
||||||
@ -245,6 +245,7 @@ if (opts.l) {
|
|||||||
if (opts.v) {
|
if (opts.v) {
|
||||||
println ""
|
println ""
|
||||||
issue.text.eachLine { println "${offset} ${it}" }
|
issue.text.eachLine { println "${offset} ${it}" }
|
||||||
|
println ""
|
||||||
issue.extendedProperties.each { name, value ->
|
issue.extendedProperties.each { name, value ->
|
||||||
def formattedValue = ExtendedPropertyHelp.format(value)
|
def formattedValue = ExtendedPropertyHelp.format(value)
|
||||||
println "${offset} * ${name}: ${formattedValue}"}
|
println "${offset} * ${name}: ${formattedValue}"}
|
||||||
@ -315,6 +316,14 @@ else if (opts.D) {
|
|||||||
if (issue.due) println "${issue.due.toString('EEE, MM/dd')} -- ${issue}"
|
if (issue.due) println "${issue.due.toString('EEE, MM/dd')} -- ${issue}"
|
||||||
else println " -- ${issue}" }
|
else println " -- ${issue}" }
|
||||||
|
|
||||||
|
def priorityDateSorter = { i1, i2 ->
|
||||||
|
if (i1.priority == i2.priority) {
|
||||||
|
def d1 = i1.due ?: new DateTime()
|
||||||
|
def d2 = i2.due ?: new DateTime()
|
||||||
|
|
||||||
|
return d1.compareTo(d2) }
|
||||||
|
else { return i1.priority - i2.priority }}
|
||||||
|
|
||||||
// Sort the issues into seperate lists based on their due dates and
|
// Sort the issues into seperate lists based on their due dates and
|
||||||
// reminders.
|
// reminders.
|
||||||
allIssues.each { issue ->
|
allIssues.each { issue ->
|
||||||
@ -338,7 +347,7 @@ else if (opts.D) {
|
|||||||
println "Tasks Scheduled for Today"
|
println "Tasks Scheduled for Today"
|
||||||
println "-------------------------"
|
println "-------------------------"
|
||||||
|
|
||||||
scheduledToday.each { printIssue(it) }
|
scheduledToday.sort(priorityDateSorter).each { printIssue(it) }
|
||||||
|
|
||||||
println "" }
|
println "" }
|
||||||
|
|
||||||
@ -346,7 +355,7 @@ else if (opts.D) {
|
|||||||
println "Tasks Due Today"
|
println "Tasks Due Today"
|
||||||
println "---------------"
|
println "---------------"
|
||||||
|
|
||||||
dueToday.each { printIssue(it) }
|
dueToday.sort(priorityDateSorter).each { printIssue(it) }
|
||||||
|
|
||||||
println ""}
|
println ""}
|
||||||
|
|
||||||
@ -354,7 +363,7 @@ else if (opts.D) {
|
|||||||
println "Upcoming Tasks"
|
println "Upcoming Tasks"
|
||||||
println "--------------"
|
println "--------------"
|
||||||
|
|
||||||
reminderToday.each { printIssue(it) }
|
reminderToday.sort(priorityDateSorter).each { printIssue(it) }
|
||||||
|
|
||||||
println ""}
|
println ""}
|
||||||
|
|
||||||
@ -362,7 +371,7 @@ else if (opts.D) {
|
|||||||
println "Other Open Issues"
|
println "Other Open Issues"
|
||||||
println "-----------------"
|
println "-----------------"
|
||||||
|
|
||||||
notDueOrReminder.each { printIssue(it) }
|
notDueOrReminder.sort(priorityDateSorter).each { printIssue(it) }
|
||||||
|
|
||||||
println "" }}
|
println "" }}
|
||||||
|
|
||||||
|
Binary file not shown.
Binary file not shown.
Binary file not shown.
Loading…
x
Reference in New Issue
Block a user