incubator-kitty-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From pids...@apache.org
Subject svn commit: r1128899 - in /incubator/kitty/trunk: ./ build.gradle src/main/java/org/apache/kitty/CmdShell.groovy src/main/java/org/apache/kitty/Main.groovy
Date Sun, 29 May 2011 16:14:50 GMT
Author: pidster
Date: Sun May 29 16:14:50 2011
New Revision: 1128899

URL: http://svn.apache.org/viewvc?rev=1128899&view=rev
Log:
add command history file, add some command completion as per KITTY-3

Modified:
    incubator/kitty/trunk/   (props changed)
    incubator/kitty/trunk/build.gradle
    incubator/kitty/trunk/src/main/java/org/apache/kitty/CmdShell.groovy
    incubator/kitty/trunk/src/main/java/org/apache/kitty/Main.groovy

Propchange: incubator/kitty/trunk/
------------------------------------------------------------------------------
--- svn:ignore (original)
+++ svn:ignore Sun May 29 16:14:50 2011
@@ -3,3 +3,7 @@ output
 build
 
 .gradle
+
+.project
+
+.classpath

Modified: incubator/kitty/trunk/build.gradle
URL: http://svn.apache.org/viewvc/incubator/kitty/trunk/build.gradle?rev=1128899&r1=1128898&r2=1128899&view=diff
==============================================================================
--- incubator/kitty/trunk/build.gradle (original)
+++ incubator/kitty/trunk/build.gradle Sun May 29 16:14:50 2011
@@ -30,7 +30,8 @@ defaultTasks 'assemble'
 title = 'Apache Kitty (Incubating)'
 description = 'This is the Apache Kitty Gradle build script'
 version = '0.1-SNAPSHOT'
-applicationName = 'apache-kitty'
+packageName = 'apache-kitty'
+applicationName = 'kitty'
 
 // --------------------------------------------------------------------
 // dependency versions
@@ -90,7 +91,7 @@ sourceSets {
 }
 
 jar {
-	baseName = "$applicationName"
+	baseName = "$packageName"
 	manifest {
 		attributes (
 			'Main-Class': 'org.apache.kitty.Main',
@@ -107,11 +108,10 @@ check {
 // --------------------------------------------------------------------
 // application plugin config
 
-applicationName = 'kitty'
 mainClassName = "org.apache.kitty.Main"
 
 distZip {
-	baseName = "$applicationName"
+	baseName = "$packageName"
 }
 
 // --------------------------------------------------------------------

Modified: incubator/kitty/trunk/src/main/java/org/apache/kitty/CmdShell.groovy
URL: http://svn.apache.org/viewvc/incubator/kitty/trunk/src/main/java/org/apache/kitty/CmdShell.groovy?rev=1128899&r1=1128898&r2=1128899&view=diff
==============================================================================
--- incubator/kitty/trunk/src/main/java/org/apache/kitty/CmdShell.groovy (original)
+++ incubator/kitty/trunk/src/main/java/org/apache/kitty/CmdShell.groovy Sun May 29 16:14:50
2011
@@ -18,8 +18,11 @@
 
 package org.apache.kitty
 
+import java.io.File
+
 import jline.ConsoleReader
 import jline.History
+import jline.SimpleCompletor
 
 import org.apache.kitty.client.Client
 import org.apache.kitty.utils.Constants
@@ -80,16 +83,21 @@ class CmdShell {
 
 		client = new Client()
 
-		def history = new History()
+		// TODO add Windows compatibility check
+		def historyFile = new File(System.getProperty("user.home"), ".kitty.history")
+		historyFile.createNewFile()
+		
+		def history = new History(historyFile)
 		def reader = new ConsoleReader()
 
 		reader.setBellEnabled(false)
 		reader.setUseHistory(true)
 		reader.setDefaultPrompt(PROMPT)
 		reader.setHistory(history)
+		reader.addCompletor(new SimpleCompletor(commands as String[]))
 
 		LOOP: while (true) {
-			def input = reader.readLine().trim()
+			def input = reader?.readLine().trim()
 
 			if (input.length() == 0)
 				continue

Modified: incubator/kitty/trunk/src/main/java/org/apache/kitty/Main.groovy
URL: http://svn.apache.org/viewvc/incubator/kitty/trunk/src/main/java/org/apache/kitty/Main.groovy?rev=1128899&r1=1128898&r2=1128899&view=diff
==============================================================================
--- incubator/kitty/trunk/src/main/java/org/apache/kitty/Main.groovy (original)
+++ incubator/kitty/trunk/src/main/java/org/apache/kitty/Main.groovy Sun May 29 16:14:50 2011
@@ -47,8 +47,6 @@ class Main {
 		 */
 
 		def opt = cli.parse(args)
-		
-		opt.
 
 		if (opt?.h) {
 			cli.usage()



Mime
View raw message