Added command to re-read the timeline source.

This commit is contained in:
Jonathan Bernard 2013-08-09 11:45:56 -05:00
parent e4a756baf5
commit 284a4159d1
4 changed files with 10 additions and 6 deletions

View File

@ -1,5 +1,5 @@
#Thu, 08 Aug 2013 23:12:38 -0500 #Fri, 09 Aug 2013 11:44:57 -0500
lib.local=true lib.local=true
name=timestamper-cli name=timestamper-cli
version=0.2 version=0.3
build.number=13 build.number=1

View File

@ -26,7 +26,7 @@ public class TimeStamperCLI {
public static final String VERSION = "0.1" public static final String VERSION = "0.1"
protected static def cli = [ protected static def cli = [
'v': [longOpt: 'version'], 'v': [longOpt: 'version'],
'd': [longOpt: 'working-directory', arguments: 1], 'd': [longOpt: 'working-directory', arguments: 1],
't': [longOpt: 'timeline-config', arguments: 1] ] 't': [longOpt: 'timeline-config', arguments: 1] ]
@ -103,7 +103,6 @@ public class TimeStamperCLI {
def readNotes = { def readNotes = {
out.println(ansi().fg(YELLOW). out.println(ansi().fg(YELLOW).
a("Notes (end with EOF or a blank line):").reset()) a("Notes (end with EOF or a blank line):").reset())
out.flush();
String notes = "" String notes = ""
String line = null String line = null
@ -164,6 +163,11 @@ public class TimeStamperCLI {
timelineProperties.save() timelineProperties.save()
break break
case ~/reload/:
timeline = timelineProperties.reloadTimeline()
currentMarker = timeline.getLastMarker(new Date())
break
default: default:
String notes = readNotes() String notes = readNotes()
currentMarker = new TimelineMarker(new Date(), line, notes) currentMarker = new TimelineMarker(new Date(), line, notes)
@ -178,7 +182,7 @@ public class TimeStamperCLI {
formatMarker(currentMarker) + formatMarker(currentMarker) +
ansi().cursorDown(1).restorCursorPosition().toString()) ansi().cursorDown(1).restorCursorPosition().toString())
out.flush(); out.flush();
Thread.sleep(200) Thread.sleep(200)
} }
} }