Author: anovarini
Date: Sat Mar 10 23:08:20 2012
New Revision: 1299299

URL: http://svn.apache.org/viewvc?rev=1299299&view=rev
Log:
Removed echoed commands

Modified:
    incubator/kitty/trunk/src/main/groovy/org/apache/kitty/CmdShell.groovy
    incubator/kitty/trunk/src/main/groovy/org/apache/kitty/Terminal.groovy
    incubator/kitty/trunk/src/main/groovy/org/apache/kitty/utils/Help.groovy

Modified: incubator/kitty/trunk/src/main/groovy/org/apache/kitty/CmdShell.groovy
URL: 
http://svn.apache.org/viewvc/incubator/kitty/trunk/src/main/groovy/org/apache/kitty/CmdShell.groovy?rev=1299299&r1=1299298&r2=1299299&view=diff
==============================================================================
--- incubator/kitty/trunk/src/main/groovy/org/apache/kitty/CmdShell.groovy 
(original)
+++ incubator/kitty/trunk/src/main/groovy/org/apache/kitty/CmdShell.groovy Sat 
Mar 10 23:08:20 2012
@@ -200,8 +200,8 @@ class CmdShell {
        }
 
        void cmdHelp() {
-               Help help = new Help()
-        ioDevice.write help.availableCommands()
+               Help help = new Help(ioDevice)
+        help.availableCommands()
        }
 
     void cmdConnect(String... args) {
@@ -251,7 +251,7 @@ class CmdShell {
        void cmdLs() {
         ioDevice.write 'listing files and directories...'
                if (remote) {
-                       getClient().ls()
+                       client.ls()
                }
                else {
             ioDevice.write Constants.ERROR_NOT_CONNECTED
@@ -262,7 +262,7 @@ class CmdShell {
                def domains = getClient().domains()
                if (domains) {
             ioDevice.write 'Domains Detected: '
-            domains.eachWithIndex() { obj, i -> println " ${i}: ${obj}" }
+            domains.eachWithIndex() { obj, i -> ioDevice.write " ${i}: ${obj}" 
}
 
                }
                else {
@@ -273,7 +273,7 @@ class CmdShell {
        void cmdCd(String path) {
         ioDevice.write 'Changing remote path...'
                if (remote) {
-                       getClient().cd(path)
+                       client.cd(path)
                }
                else {
             ioDevice.write Constants.ERROR_NOT_CONNECTED
@@ -283,7 +283,7 @@ class CmdShell {
        void cmdGet(def attr) {
         ioDevice.write "Get $attr..."
                if (remote) {
-                       getClient().get(attr)
+                       client.get(attr)
                }
                else {
             ioDevice.write Constants.ERROR_NOT_CONNECTED
@@ -293,7 +293,7 @@ class CmdShell {
        void cmdSet(def attr, def val) {
         ioDevice.write "Set $attr to $val"
                if (remote) {
-                       getClient().set(attr, val)
+                       client.set(attr, val)
                }
                else {
             ioDevice.write Constants.ERROR_NOT_CONNECTED
@@ -303,7 +303,7 @@ class CmdShell {
        void cmdInvoke(def op, def params) {
         ioDevice.write "Invoking the following operation: $op"
                if (remote) {
-                       getClient().invoke(op, params)
+                       client.invoke(op, params)
                }
                else {
             ioDevice.write Constants.ERROR_NOT_CONNECTED
@@ -313,7 +313,7 @@ class CmdShell {
        void cmdPwd() {
         ioDevice.write 'Displaying the current remote path...'
                if (remote) {
-                       String name = (String) getClient().pwd()
+                       String name = (String) client.pwd()
             ioDevice.write name
                }
                else {
@@ -324,7 +324,7 @@ class CmdShell {
        void cmdSetDomain(def domain) {
         ioDevice.write "Setting the domain to $domain..."
                if (remote) {
-                       getClient().setDomain(domain)
+                       client.domain = domain
                }
                else {
             ioDevice.write Constants.ERROR_NOT_CONNECTED

Modified: incubator/kitty/trunk/src/main/groovy/org/apache/kitty/Terminal.groovy
URL: 
http://svn.apache.org/viewvc/incubator/kitty/trunk/src/main/groovy/org/apache/kitty/Terminal.groovy?rev=1299299&r1=1299298&r2=1299299&view=diff
==============================================================================
--- incubator/kitty/trunk/src/main/groovy/org/apache/kitty/Terminal.groovy 
(original)
+++ incubator/kitty/trunk/src/main/groovy/org/apache/kitty/Terminal.groovy Sat 
Mar 10 23:08:20 2012
@@ -18,7 +18,7 @@ package org.apache.kitty
 
 import jline.History
 import jline.SimpleCompletor
-import jline.ConsoleReader
+    import jline.ConsoleReader
 
 class Terminal implements IODevice {
 
@@ -44,10 +44,10 @@ class Terminal implements IODevice {
     }
 
     String read() {
-        reader?.readLine()?.trim()
+        reader?.readLine(0 as char)?.trim()
     }
 
     void write(String message) {
-        reader.printString message
+        reader.printString "$message\n"
     }
 }

Modified: 
incubator/kitty/trunk/src/main/groovy/org/apache/kitty/utils/Help.groovy
URL: 
http://svn.apache.org/viewvc/incubator/kitty/trunk/src/main/groovy/org/apache/kitty/utils/Help.groovy?rev=1299299&r1=1299298&r2=1299299&view=diff
==============================================================================
--- incubator/kitty/trunk/src/main/groovy/org/apache/kitty/utils/Help.groovy 
(original)
+++ incubator/kitty/trunk/src/main/groovy/org/apache/kitty/utils/Help.groovy 
Sat Mar 10 23:08:20 2012
@@ -16,6 +16,7 @@
 */
 package org.apache.kitty.utils
 
+import org.apache.kitty.IODevice
 
 /**
  *
@@ -24,7 +25,13 @@ package org.apache.kitty.utils
  */
 class Help {
 
-       public String availableCommands()
+    IODevice ioDevice
+
+    Help(IODevice ioDevice) {
+        this.ioDevice = ioDevice
+    }
+
+       void availableCommands()
        {
                StringBuffer sb = new StringBuffer()
                
@@ -41,7 +48,7 @@ class Help {
                sb.append "ls - List all objects and attributes in current 
mbean path\n"
                sb.append "pwd - print working directory of mbean path \n"
 
-        return sb.toString()
+        ioDevice.write sb.toString()
        }
 
 }


Reply via email to