Change the scope for our commands and display scope in help message. (FELIX-2042)
git-svn-id: https://svn.apache.org/repos/asf/felix/trunk@947700 13f79535-47bb-0310-9956-ffa450edef68
diff --git a/gogo/felixcommands/src/main/java/org/apache/felix/gogo/felixcommands/Activator.java b/gogo/felixcommands/src/main/java/org/apache/felix/gogo/felixcommands/Activator.java
index 9ee9d85..b05a1e5 100644
--- a/gogo/felixcommands/src/main/java/org/apache/felix/gogo/felixcommands/Activator.java
+++ b/gogo/felixcommands/src/main/java/org/apache/felix/gogo/felixcommands/Activator.java
@@ -30,7 +30,7 @@
public void start(BundleContext bc) throws Exception
{
Hashtable props = new Hashtable();
- props.put("osgi.command.scope", "basic");
+ props.put("osgi.command.scope", "felix");
props.put("osgi.command.function", new String[] {
"bundlelevel", "frameworklevel", "headers",
"help", "install", "inspect", "lb", "log", "refresh",
@@ -39,7 +39,7 @@
bc.registerService(
Basic.class.getName(), new Basic(bc), props);
- props.put("osgi.command.scope", "files");
+ props.put("osgi.command.scope", "felix");
props.put("osgi.command.function", new String[] {
"cd", "ls" });
bc.registerService(
diff --git a/gogo/felixcommands/src/main/java/org/apache/felix/gogo/felixcommands/Basic.java b/gogo/felixcommands/src/main/java/org/apache/felix/gogo/felixcommands/Basic.java
index 79f8465..c6f2665 100644
--- a/gogo/felixcommands/src/main/java/org/apache/felix/gogo/felixcommands/Basic.java
+++ b/gogo/felixcommands/src/main/java/org/apache/felix/gogo/felixcommands/Basic.java
@@ -230,6 +230,7 @@
String k = entry.getKey().substring(entry.getKey().indexOf(':') + 1);
if (name.equals(k))
{
+ name = entry.getKey();
methods = entry.getValue();
break;
}
@@ -255,6 +256,8 @@
System.out.println("\n" + m.getName() + " - " + d.description());
}
+ System.out.println(" scope: " + name.substring(0, name.indexOf(':')));
+
// Get flags and options.
Class[] paramTypes = m.getParameterTypes();
Map<String, Flag> flags = new TreeMap();