2 Commits
v0.6 ... v0.8

Author SHA1 Message Date
e893da72b6 Bugfix: typo in variable name. 2013-05-06 16:14:25 -05:00
62e62404c1 Bugfixes for new command. 2013-05-01 15:02:50 -05:00
2 changed files with 11 additions and 9 deletions

View File

@ -1,7 +1,7 @@
#Wed, 01 May 2013 14:36:31 -0500
#Mon, 06 May 2013 16:13:08 -0500
lib.local=true
name=jdb-gtd
version=0.6
version=0.8
nailgun.classpath.dir=/home/jdbernard/programs/nailgun/classpath
build.number=1

View File

@ -10,7 +10,7 @@ import org.joda.time.DateTime
public class GTDCLI {
public static final String VERSION = "0.6"
public static final String VERSION = "0.8"
private static String EOL = System.getProperty("line.separator")
private static GTDCLI nailgunInst
@ -96,7 +96,7 @@ public class GTDCLI {
case ~/cal|calendar/: calendar(parsedArgs); break
case ~/process/: process(parsedArgs); break
case ~/list-copies/: listCopies(parsedArgs); break
case ~/new/: newAction(parsedArgs);
case ~/new/: newAction(parsedArgs); break
default:
println "Unrecognized command: ${command}"
break } } }
@ -259,7 +259,7 @@ public class GTDCLI {
if (inPath(gtdDirs.projects, oldFile)) {
// Delete any copies of this item in the next actions folder.
findAllCopies(oldFile, gtdDrs."next-actions").each { file ->
findAllCopies(oldFile, gtdDirs."next-actions").each { file ->
println "Deleting duplicate entry from the " +
"${file.parentFile.name} context."
file.delete() }
@ -338,8 +338,10 @@ public class GTDCLI {
protected void newAction(LinkedList args) {
def response = prompt("Next action?", "")
def item = new Item(new File(workingDir, stringToFilename(response)))
def response = prompt(["Next action?", ""])
def file = new File(workingDir, stringToFilename(response))
file.createNewFile()
def item = new Item(file)
item.action = response
@ -348,7 +350,7 @@ public class GTDCLI {
println "End with an empty line."
print "> "
while (response = stdin.readLine().trim()) {
while (response = stdin.nextLine().trim()) {
if (!(response =~ /[:=]/)) continue
def parts = response.split(/[:=]/)
item[parts[0].trim().toLowerCase()] =
@ -530,7 +532,7 @@ directory."""
return [:] }
protected String prompt(String message) {
protected String prompt(def msg) {
if (msg instanceof List) msg = msg.join(EOL)
msg += "> "
print msg