You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@karaf.apache.org by Matthias <mi...@web.de> on 2020/02/24 19:03:21 UTC

Edit Multiline Text

Hi,

I want to use a custom command in karaf to edit a text with multiline "\n".

My problem is not to set a multiline text, because this works fine with
quotation (") at start and then add the wanted text. 

My problem is to "reload" the text, so it can be edited again. If i add it
to a completer then the edit exits karaf with a string out of range
exception.

Is there a way to re-edit multilined text? How should i pass it to the
command?

Regards,
Matthias



--
Sent from: http://karaf.922171.n3.nabble.com/Karaf-User-f930749.html

Re: Edit Multiline Text

Posted by Jean-Baptiste Onofre <jb...@nanthrax.net>.
Hi,

Less or nano commands are part of gogo jline posix:

https://github.com/apache/felix/blob/trunk/gogo/jline/src/main/java/org/apache/felix/gogo/jline/Posix.java <https://github.com/apache/felix/blob/trunk/gogo/jline/src/main/java/org/apache/felix/gogo/jline/Posix.java>

Regards
JB

> Le 24 févr. 2020 à 21:31, Matthias Wegner <mi...@web.de> a écrit :
> 
> Hi JB, can you give me a hint where i find the source.
> 
> At https://github.com/apache/karaf/search?q=less&unscoped_q=less i not
> find the command.
> 
> Regards, MW
> 
> Am 24.02.20 um 21:02 schrieb Jean-Baptiste Onofre:
>> Hi,
>> 
>> You can take a look how we implemented the less command for instance (or vi/edit). It’s pretty close to what you are looking for.
>> 
>> Regards
>> JB
>> 
>>> Le 24 févr. 2020 à 20:03, Matthias <mi...@web.de> a écrit :
>>> 
>>> Hi,
>>> 
>>> I want to use a custom command in karaf to edit a text with multiline "\n".
>>> 
>>> My problem is not to set a multiline text, because this works fine with
>>> quotation (") at start and then add the wanted text.
>>> 
>>> My problem is to "reload" the text, so it can be edited again. If i add it
>>> to a completer then the edit exits karaf with a string out of range
>>> exception.
>>> 
>>> Is there a way to re-edit multilined text? How should i pass it to the
>>> command?
>>> 
>>> Regards,
>>> Matthias
>>> 
>>> 
>>> 
>>> --
>>> Sent from: http://karaf.922171.n3.nabble.com/Karaf-User-f930749.html
> 
> --
> Matthias Wegner
> Hauptstrasse 41a
> 79199 Kirchzarten
> Tel.: 07661 9091000
> Mobil: 0716 47893182
> 


Re: Edit Multiline Text

Posted by Matthias Wegner <mi...@web.de>.
Hi JB, can you give me a hint where i find the source.

At https://github.com/apache/karaf/search?q=less&unscoped_q=less i not
find the command.

Regards, MW

Am 24.02.20 um 21:02 schrieb Jean-Baptiste Onofre:
> Hi,
>
> You can take a look how we implemented the less command for instance (or vi/edit). It’s pretty close to what you are looking for.
>
> Regards
> JB
>
>> Le 24 févr. 2020 à 20:03, Matthias <mi...@web.de> a écrit :
>>
>> Hi,
>>
>> I want to use a custom command in karaf to edit a text with multiline "\n".
>>
>> My problem is not to set a multiline text, because this works fine with
>> quotation (") at start and then add the wanted text.
>>
>> My problem is to "reload" the text, so it can be edited again. If i add it
>> to a completer then the edit exits karaf with a string out of range
>> exception.
>>
>> Is there a way to re-edit multilined text? How should i pass it to the
>> command?
>>
>> Regards,
>> Matthias
>>
>>
>>
>> --
>> Sent from: http://karaf.922171.n3.nabble.com/Karaf-User-f930749.html

--
Matthias Wegner
Hauptstrasse 41a
79199 Kirchzarten
Tel.: 07661 9091000
Mobil: 0716 47893182


Re: Edit Multiline Text

Posted by Jean-Baptiste Onofre <jb...@nanthrax.net>.
Hi,

You can take a look how we implemented the less command for instance (or vi/edit). It’s pretty close to what you are looking for.

Regards
JB

> Le 24 févr. 2020 à 20:03, Matthias <mi...@web.de> a écrit :
> 
> Hi,
> 
> I want to use a custom command in karaf to edit a text with multiline "\n".
> 
> My problem is not to set a multiline text, because this works fine with
> quotation (") at start and then add the wanted text. 
> 
> My problem is to "reload" the text, so it can be edited again. If i add it
> to a completer then the edit exits karaf with a string out of range
> exception.
> 
> Is there a way to re-edit multilined text? How should i pass it to the
> command?
> 
> Regards,
> Matthias
> 
> 
> 
> --
> Sent from: http://karaf.922171.n3.nabble.com/Karaf-User-f930749.html