Adding a command call to a Unix command-line application

I am working on a command line application for Solaris written in Java6. I would like to scroll through the history of previous commands using the up and down arrows, as many Unix tools do (shells, VIM command line mode hint, etc.).

Is there any standard way to achieve this, or do I need to minimize on my own?

+3
source share
5 answers

Yes, use the GNU readline library .

+5
source

I think you are looking for something like JLine , but I never used it, so I can not confirm its quality.

, -, , (feb ), .

+3

ledit Linux . , .

: ledit , .

: http://cristal.inria.fr/~ddr/ledit/

+2

SourceForge, http://java-readline.sourceforge.net/, JNI GNU readline. ( ), , , .

+1

: GNU readline GPL:

Readline - , GNU General , 2. Readline , , GPL . GPL, licensing@gnu.org.

, Readline GPL- . ( LGPL, .)

, , , -.

wikipedia , JLine, .

: , . (0) . , ( / , ); , . (// , , , GPL, ). ; FDA, , , : ", , XYZ" - .

+1
source

Source: https://habr.com/ru/post/1696722/


All Articles