geronimo-scm mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From jdil...@apache.org
Subject svn commit: r595891 - /geronimo/gshell/trunk/gshell-commands/gshell-builtins/src/main/java/org/apache/geronimo/gshell/commands/builtins/ClearCommand.java
Date Sat, 17 Nov 2007 01:23:49 GMT
Author: jdillon
Date: Fri Nov 16 17:23:47 2007
New Revision: 595891

URL: http://svn.apache.org/viewvc?rev=595891&view=rev
Log:
(GSHELL-37) Complain if ANSI is not enabled, since JLine clear impl relys on ANSI

Modified:
    geronimo/gshell/trunk/gshell-commands/gshell-builtins/src/main/java/org/apache/geronimo/gshell/commands/builtins/ClearCommand.java

Modified: geronimo/gshell/trunk/gshell-commands/gshell-builtins/src/main/java/org/apache/geronimo/gshell/commands/builtins/ClearCommand.java
URL: http://svn.apache.org/viewvc/geronimo/gshell/trunk/gshell-commands/gshell-builtins/src/main/java/org/apache/geronimo/gshell/commands/builtins/ClearCommand.java?rev=595891&r1=595890&r2=595891&view=diff
==============================================================================
--- geronimo/gshell/trunk/gshell-commands/gshell-builtins/src/main/java/org/apache/geronimo/gshell/commands/builtins/ClearCommand.java
(original)
+++ geronimo/gshell/trunk/gshell-commands/gshell-builtins/src/main/java/org/apache/geronimo/gshell/commands/builtins/ClearCommand.java
Fri Nov 16 17:23:47 2007
@@ -28,6 +28,7 @@
 import org.apache.geronimo.gshell.command.CommandSupport;
 import org.apache.geronimo.gshell.command.annotation.CommandComponent;
 import org.apache.geronimo.gshell.command.annotation.Requirement;
+import org.apache.geronimo.gshell.ansi.ANSI;
 
 /**
  * Clear the terminal screen.
@@ -44,7 +45,13 @@
     protected Object doExecute() throws Exception {
         ConsoleReader reader = new ConsoleReader(io.inputStream, new PrintWriter(io.outputStream,
true), /*bindings*/ null, terminal);
         
-        reader.clearScreen();
+        if (!ANSI.isEnabled()) {
+        	io.out.println("ANSI is not enabled.  The clear command is not functional");
+        }
+        else {
+        	reader.clearScreen();
+        	return SUCCESS;
+        }
         
         return SUCCESS;
     }



Mime
View raw message