Java command line "shell" with autocomplete

I need to create a Java command line that will be called remotely on the server. He will have to:

  • Read the β€œlines” of text from the user.
  • Recognize that the user presses the tab key to simplify completion.
  • Recognize that the user presses the up / down keys for the story.

Before I leave and download my own, Does anyone know of a Java library that can facilitate all or part of this?

i.e. From the command line in ssh, it might look like this:

bob> java -jar MyTool.jar

MyTool is running.
Enter the command:

> server1 startup
server starts ...
server is running

server2 account downloads
Done

> server3 shutdown
Full

<P β†’ quit smoking
+6
source share
7 answers

Check out JReadline and jline2 .

+5
source

Update: picocli-shell-jline2 and picocli-shell-jline3 combine the power of JLine 2 and 3 with picocli .

Picocli allows you to write commands (and subcommands) with options and positional parameters using very little code , and the library will generate JLine 2 and 3 command terminators for all commands.

ANSI , , , .

enter image description here

: - .

+2

, , .

  • , , .

  • bash - - , , , bash - . ( , , , , bash script - )

  • , , , , , : Java?

, , , "" .

+1

BeanShell? (, bash csh), java- , .

bean 1.X, , , .

+1

, python. , Java , , Java -, .

- . eclipse netbeans. , , .

, .

0
0

Apache Karaf , . . Karaf , , script.

; . , .

0

All Articles