You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@karaf.apache.org by Francois Papon <fr...@openobject.fr> on 2018/03/01 14:07:43 UTC

[JLINE] - interactive command

Hi,

I would like to know if it's possible to use interactive command in Karaf ?

For example, using the jdbc command, actually we use :

karaf@root()> jdbc:ds-create -url "jdbc:h2:file:/tmp/decanter" -dc
org.apache.derby.jdbc.EmbeddedDriver -dbName decanter jdbc/decanter

We could use :

karaf@root()> jdbc:ds-create

    DriverClass [org.apache.derby.jdbc.EmbeddedDriver] :
org.apache.derby.jdbc.EmbeddedDriver

    URL [jdbc:h2:file:/tmp/dbfile] : jdbc:h2:file:/tmp/decanter

    Database name [mydb] : decanter

    Jdbc name [jdbc/mydb] : jdbc/decanter

    Create datasource ? [Y/n] : Y

karaf@root()>

Is it possible with JLine and the command specifications in Karaf ?

François


Re: [JLINE] - interactive command

Posted by Jean-Baptiste Onofré <jb...@nanthrax.net>.
Hi François

It's not possible directly using the command annotations. They are inline.

However, a command can already implement it using the session and terminal but it's up to the command to deal with the terminal read.

It could be a nice addition to the annotations but it should be at gogo level IMHO.

Regards
JB

Le 1 mars 2018 à 18:07, à 18:07, Francois Papon <fr...@openobject.fr> a écrit:
>Hi,
>
>I would like to know if it's possible to use interactive command in
>Karaf ?
>
>For example, using the jdbc command, actually we use :
>
>karaf@root()> jdbc:ds-create -url "jdbc:h2:file:/tmp/decanter" -dc
>org.apache.derby.jdbc.EmbeddedDriver -dbName decanter jdbc/decanter
>
>We could use :
>
>karaf@root()> jdbc:ds-create
>
>    DriverClass [org.apache.derby.jdbc.EmbeddedDriver] :
>org.apache.derby.jdbc.EmbeddedDriver
>
>    URL [jdbc:h2:file:/tmp/dbfile] : jdbc:h2:file:/tmp/decanter
>
>    Database name [mydb] : decanter
>
>    Jdbc name [jdbc/mydb] : jdbc/decanter
>
>    Create datasource ? [Y/n] : Y
>
>karaf@root()>
>
>Is it possible with JLine and the command specifications in Karaf ?
>
>François