felix-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From pde...@apache.org
Subject svn commit: r956505 - in /felix/trunk/dependencymanager/shell/src/main/java/org/apache/felix/dm/shell: Activator.java GogoDMCommand.java
Date Mon, 21 Jun 2010 09:08:53 GMT
Author: pderop
Date: Mon Jun 21 09:08:52 2010
New Revision: 956505

URL: http://svn.apache.org/viewvc?rev=956505&view=rev
Log:
Fixed Gogo command in order to keep the same syntax from other shells

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

Modified: felix/trunk/dependencymanager/shell/src/main/java/org/apache/felix/dm/shell/Activator.java
URL: http://svn.apache.org/viewvc/felix/trunk/dependencymanager/shell/src/main/java/org/apache/felix/dm/shell/Activator.java?rev=956505&r1=956504&r2=956505&view=diff
==============================================================================
--- felix/trunk/dependencymanager/shell/src/main/java/org/apache/felix/dm/shell/Activator.java
(original)
+++ felix/trunk/dependencymanager/shell/src/main/java/org/apache/felix/dm/shell/Activator.java
Mon Jun 21 09:08:52 2010
@@ -47,7 +47,7 @@ public class Activator implements Bundle
             Hashtable props = new Hashtable();
             props.put(org.apache.felix.service.command.CommandProcessor.COMMAND_SCOPE, "dependencymanager");
             props.put(org.apache.felix.service.command.CommandProcessor.COMMAND_FUNCTION,

-                      new String[] { "dmhelp", "dm", "dmnodeps", "dmnotavail", "dmcompact"
});
+                      new String[] { "dm", "dmhelp" });
             context.registerService(GogoDMCommand.class.getName(), new GogoDMCommand(context),
props);
         }
         catch (Throwable t) {            

Modified: felix/trunk/dependencymanager/shell/src/main/java/org/apache/felix/dm/shell/GogoDMCommand.java
URL: http://svn.apache.org/viewvc/felix/trunk/dependencymanager/shell/src/main/java/org/apache/felix/dm/shell/GogoDMCommand.java?rev=956505&r1=956504&r2=956505&view=diff
==============================================================================
--- felix/trunk/dependencymanager/shell/src/main/java/org/apache/felix/dm/shell/GogoDMCommand.java
(original)
+++ felix/trunk/dependencymanager/shell/src/main/java/org/apache/felix/dm/shell/GogoDMCommand.java
Mon Jun 21 09:08:52 2010
@@ -17,47 +17,12 @@ public class GogoDMCommand extends DMCom
     }
     
     public void dmhelp() {
-        System.out.println("dependencymanager:dm -> list DM component diagnostics.");
-        System.out.println("dependencymanager:dm bundleId -> list DM component diagnostics
for a given bundle.");
-        System.out.println("dependencymanager:dmnotavail -> list unavailable DM components.");
-        System.out.println("dependencymanager:dmnotavail bundleId -> list unavailable
DM components for a given bundle.");
-        System.out.println("dependencymanager:dmnodeps -> list DM component diagnostics
without dependencies.");
-        System.out.println("dependencymanager:dmnodeps bundleId-> list DM component diagnostics
without dependencies for a given bundle.");
-        System.out.println("dependencymanager:dmcompact -> list DM component compact diagnostics.");
-        System.out.println("dependencymanager:dmcompact bundleId -> list DM component
compact diagnostics for a given bundle.");
+        System.out.println("list Dependency Manager component diagnostics. Usage: dm [nodeps]
[notavail] [compact] [<bundleid> ...]");
     }
     
-    public void dm() {
-        execute("dm", new String[0]);
+    public void dm(String[] args) {
+        execute("dm", args);
     }
-
-    public void dm(int bundleId) {
-        execute("dm", new String[] { String.valueOf(bundleId) });
-    }
-
-    public void dmnodeps() {
-        execute("dm nodeps", new String[0]);
-    }
-    
-    public void dmnodeps(int bundleId) {
-        execute("dm nodeps", new String[] { String.valueOf(bundleId) });
-    }
-    
-    public void dmnotavail() {
-        execute("dm notavail", new String[0]);
-    }
-   
-   public void dmnotavail(int bundleId) {
-       execute("dm notavail", new String[] { String.valueOf(bundleId) });
-   }
-
-   public void dmcompact() {
-       execute("dm compact", new String[0]);
-   }    
-
-   public void dmcompact(int bundleId) {
-        execute("dm compact", new String[] { String.valueOf(bundleId) });
-   }    
         
    private void execute(String line, String[] args) {
        ByteArrayOutputStream bytes = new ByteArrayOutputStream();
@@ -65,8 +30,8 @@ public class GogoDMCommand extends DMCom
        PrintStream out = new PrintStream(bytes);
        PrintStream err = new PrintStream(errorBytes);
         
-       if (args != null && args.length > 0) {
-           line += " " + args[0]; // Add bundle Id
+       for (int i = 0; i < args.length; i ++) {
+           line += " " + args[i];
        }
         
        super.execute(line.toString(), out, err);



Mime
View raw message