felix-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From ma...@apache.org
Subject svn commit: r888362 - /felix/trunk/dependencymanager/shell/src/main/java/org/apache/felix/dm/shell/EquinoxDMCommand.java
Date Tue, 08 Dec 2009 12:15:01 GMT
Author: marrs
Date: Tue Dec  8 12:15:01 2009
New Revision: 888362

URL: http://svn.apache.org/viewvc?rev=888362&view=rev
Log:
fixed the shell equinox shell command

Modified:
    felix/trunk/dependencymanager/shell/src/main/java/org/apache/felix/dm/shell/EquinoxDMCommand.java

Modified: felix/trunk/dependencymanager/shell/src/main/java/org/apache/felix/dm/shell/EquinoxDMCommand.java
URL: http://svn.apache.org/viewvc/felix/trunk/dependencymanager/shell/src/main/java/org/apache/felix/dm/shell/EquinoxDMCommand.java?rev=888362&r1=888361&r2=888362&view=diff
==============================================================================
--- felix/trunk/dependencymanager/shell/src/main/java/org/apache/felix/dm/shell/EquinoxDMCommand.java
(original)
+++ felix/trunk/dependencymanager/shell/src/main/java/org/apache/felix/dm/shell/EquinoxDMCommand.java
Tue Dec  8 12:15:01 2009
@@ -13,7 +13,7 @@
     }
     
     public void _dm(CommandInterpreter ci) {
-        StringBuffer line = new StringBuffer("");
+        StringBuffer line = new StringBuffer("dm ");
         String arg = ci.nextArgument();
         while (arg != null) {
             if (line.length() > 0) {
@@ -24,8 +24,16 @@
         }
         ByteArrayOutputStream bytes = new ByteArrayOutputStream();
         ByteArrayOutputStream errorBytes = new ByteArrayOutputStream();
-        super.execute(line.toString(), new PrintStream(bytes), new PrintStream(errorBytes));
-        ci.print(new String(bytes.toByteArray()));
+        PrintStream out = new PrintStream(bytes);
+        PrintStream err = new PrintStream(errorBytes);
+        super.execute(line.toString(), out, err);
+        if (bytes.size() > 0) {
+            ci.print(new String(bytes.toByteArray()));
+        }
+        if (errorBytes.size() > 0) {
+            ci.print("Error:\n");
+            ci.print(new String(errorBytes.toByteArray()));
+        }
     }
 
     public String getHelp() {



Mime
View raw message