Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

openhab --help console command missing #1715

Closed
ghys opened this issue Oct 12, 2020 · 4 comments · Fixed by #2953
Closed

openhab --help console command missing #1715

ghys opened this issue Oct 12, 2020 · 4 comments · Fixed by #2953

Comments

@ghys
Copy link
Member

ghys commented Oct 12, 2020

I noticed typing openhab --help in the console, or help openhab doesn't output anything.
openhab:help works though.
I don't remember if that were the case with the former smarthome command scope.

@kaikreuzer
Copy link
Member

I don't think this has ever worked.
It seems to be in line with some other commands, though:

openhab> cm --help
openhab> help cm

I just tried to analyze what might need to be added, but interestingly the CommandWrapper is never called by Karaf for those commands. Maybe it is not correct that name = "help" is specified, but I haven't found any documentation on how to actually correctly do it in Karaf.

@J-N-K
Copy link
Member

J-N-K commented May 8, 2022

I had a look at this yesterday and made an interesting observation: if I change the scope to openhabx (or others different from openhab) and add a proper Karaf-Commands entry to the manifest, it works. I didn’t find out yet what is the difference between openhab and openhabx as scope name. It is clearly not the other command in the org.openhab.core.karaf bundle, that also does not work and starts to work when the scope is changed.

@J-N-K
Copy link
Member

J-N-K commented May 8, 2022

Ok. Figured it out. The issue is that two bundles provide in the same scope. IMO this is a bug in Karaf, because the ShellHelpProvider correctly determines all commands for the scope (by looking at command.startsWith(scope) and then discards the result if they are spread over more than one bundle. But that's debatable.

So it is not possible to have scopes starting with or equal to openhab in two bundles (which we currently have, in org.openhab.core.karaf for the install-service command and in org.openhab.core.io.console.karaf for the other commands.

@kaikreuzer
Copy link
Member

Great, thanks for the analysis!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants