Hi,
I did a quick look at the code. It seems karaf is wrapping gogo annotations
into its own ones and making them run as if they are karaf commands.
However the commands with only published service
properties(osgi.command.scope,osgi.command.function) are tracked for
execution into CommandProcessor, but left out in CommandListHelpProvider.
With a quick fix I've been able to make them appear on command list,
without description though!
To display usage for commands, more need to be done of course. The first
way that could come to my mind is: We could add description and argument
informations into CommandProxy(wrapper around plain osgi commands) by
analyzing command's object against @Description annotations, then use this
information in SingleCommandHelpProvider.
I would like to have some advice from karaf devs before working on a patch,
since I also need to make some of my command implementations to be appear
on help.
Best,
Gokturk
On Tue, Jan 8, 2013 at 9:26 AM, Guillaume Nodet wrote:
> That's because completion and the help system is specific to karaf
> commands, as they are when you use the gogo commands (for help at least).
> This is kinda historical as the karaf commands did exist before gogo
> commands annotations. I suppose the karaf help system could be able
> recognize plain gogo commands and display help correctly though. You could
> raise a JIRA issue for that, I think it's doable, though I don't think we
> provide the annotations in the basic karaf distribution.
>
>
> On Tue, Jan 8, 2013 at 1:46 AM, Gareth wrote:
>
>> Hello,
>>
>> I am curious - What is the difference between a Gogo command and a Karaf
>> command?
>>
>> I ask because I wrote for myself a couple of gogo commands. If I run
>> vanilla
>> OSGi (e.g. equinox) with gogo they run fine. The commands also show up if
>> I
>> run gogo "help".
>>
>> If I run these same gogo commands in karaf, they also appear to work.
>> However, the commands don't show up in Karaf help and I cannot take
>> advantage of other advanced karaf console features like autocomplete with
>> these commands.
>>
>> Any reason why this would not work? Is there perhaps just an additional
>> service property I can add which will allow me to take advantage of the
>> additional Karaf console support? Having looked at a few Karaf console
>> command examples, I see they all extend the Karaf class
>> OsgiCommandSupport,
>> which I prefer not to do as I would like to avoid having to explicitly
>> depend on Karaf classes.
>>
>> thanks in advance,
>> Gareth
>>
>>
>>
>>
>> --
>> View this message in context:
>> http://karaf.922171.n3.nabble.com/Gogo-vs-Karaf-Commands-tp4027219.html
>> Sent from the Karaf - User mailing list archive at Nabble.com.
>>
>
>
>
> --
>
> Guillaume Nodet
>
> Blog: http://gnodet.blogspot.com/
>
> FuseSource, Integration everywhere
> http://fusesource.com
>