karaf-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Guillaume Nodet <gno...@apache.org>
Subject Re: Recognise commands in completer class
Date Thu, 18 May 2017 11:27:32 GMT
I think one way would be the following:
  * get the org.apache.karaf.shell.api.console.SessionFactory service from
the OSGi registry
  * register your own org.apache.karaf.shell.api.console.Command
implementation using sessionFactory.getRegistry().register(command)
  * the completer will be retrieved by the shell using
command.getCompleter(scoped) and you have full control to share a single
instance of the completer
  * the completer receives the parsed command line, so you can do whatever
you want with it

2017-05-18 11:25 GMT+02:00 Dominik Marciniszyn <
marciniszyn.dominik@gmail.com>:

> Hi,
>
> I would like to create one Completer class which will be able to recognise
> which command was given by user and I would like to print completion
> depends
> on command.
>
> Is it possible or is example how to do this?
>
> Thank You for any help
>
>
>
> --
> View this message in context: http://karaf.922171.n3.nabble.
> com/Recognise-commands-in-completer-class-tp4050383.html
> Sent from the Karaf - Dev mailing list archive at Nabble.com.
>



-- 
------------------------
Guillaume Nodet

Mime
  • Unnamed multipart/alternative (inline, None, 0 bytes)
View raw message