Fix "openhab --help" and "help openhab" in Karaf console (#2953)

* Enable "openhab --help" and "help openhab" in Karaf console

Signed-off-by: Jan N. Klug <github@klug.nrw>
This commit is contained in:
J-N-K 2022-05-16 22:39:45 +02:00 committed by GitHub
parent 910047355c
commit b52d9f2e4f
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
8 changed files with 11 additions and 12 deletions

View File

@ -0,0 +1 @@
Karaf-Commands: org.openhab.core.io.console.karaf.internal

View File

@ -26,6 +26,12 @@
<artifactId>org.openhab.core.io.console</artifactId>
<version>${project.version}</version>
</dependency>
<dependency>
<groupId>org.apache.karaf.wrapper</groupId>
<artifactId>org.apache.karaf.wrapper.core</artifactId>
<version>${karaf.compile.version}</version>
<scope>provided</scope>
</dependency>
</dependencies>
</project>

View File

@ -14,7 +14,6 @@ package org.openhab.core.io.console.karaf.internal;
import java.util.Arrays;
import java.util.List;
import java.util.stream.Collectors;
import org.apache.karaf.shell.api.action.Action;
import org.apache.karaf.shell.api.action.lifecycle.Reference;
@ -66,7 +65,7 @@ public class CommandWrapper implements Command, Action {
@Override
public Object execute(Session session, List<Object> argList) throws Exception {
String[] args = argList.stream().map(a -> a.toString()).collect(Collectors.toList()).toArray(new String[0]);
String[] args = argList.stream().map(Object::toString).toArray(String[]::new);
final Console console = new OSGiConsole(getScope(), session.getConsole());

View File

@ -10,7 +10,7 @@
*
* SPDX-License-Identifier: EPL-2.0
*/
package org.openhab.core.karaf.internal.command;
package org.openhab.core.io.console.karaf.internal;
import static org.apache.karaf.shell.support.ansi.SimpleAnsi.*;

View File

@ -1,2 +0,0 @@
Bundle-SymbolicName: ${project.artifactId}
Karaf-Commands: org.openhab.core.karaf.internal.command

View File

@ -43,12 +43,6 @@
<version>${karaf.compile.version}</version>
<scope>provided</scope>
</dependency>
<dependency>
<groupId>org.apache.karaf.wrapper</groupId>
<artifactId>org.apache.karaf.wrapper.core</artifactId>
<version>${karaf.compile.version}</version>
<scope>provided</scope>
</dependency>
<dependency>
<groupId>org.apache.karaf.jaas</groupId>
<artifactId>org.apache.karaf.jaas.modules</artifactId>

View File

@ -116,6 +116,7 @@
<feature name="openhab-core-io-console-karaf" description="Karaf Console support for SmartHome stuff" version="${project.version}">
<feature>openhab-core-base</feature>
<feature>shell</feature>
<feature>service-wrapper</feature>
<bundle>mvn:org.openhab.core.bundles/org.openhab.core.io.console.karaf/${project.version}</bundle>
</feature>

View File

@ -14,4 +14,4 @@ org.openhab.core.ui.internal.proxy.ProxyServletService=AvoidCatchingThrowable
org.openhab.core.automation.internal.RuleEngineImpl=AvoidCatchingThrowable
org.openhab.core.automation.internal.RuleRegistryImpl=CompareObjectsWithEquals
org.openhab.core.automation.internal.provider.AutomationResourceBundlesEventQueue=AvoidCatchingThrowable
org.openhab.core.karaf.internal.command.InstallServiceCommand=SystemPrintln
org.openhab.core.io.console.karaf.internal.InstallServiceCommand=SystemPrintln