I can't seem to find an example that uses more than one command per line.
For example, say I want to write a cli similar to cisco ios, where you may have multiple levels of commands on the one line.
eg. first word could be "show", then when you type "show " and hit tab, the next set of options are displayed (the cisco exmaple uses "?" to show the list).
eg:
gw1#show ?
aaa Show AAA values
access-expression List access expression
access-lists List access lists
accounting Accounting data for active sessions
adjacency Adjacent nodes
..
gw1#show ip ?
access-lists List IP access lists
accounting The active IP accounting database
admission Network Admission Control information
aliases IP alias table
arp IP ARP table
..
gw1#show ip interface ?
ATM ATM interface
Async Async interface
BVI Bridge-Group Virtual Interface
CDMA-Ix CDMA Ix interface
..
gw1#show ip interface
I'm thinking of using readCharacter to read one character at a time and then parse the line so far once I see a space.
Has anyone else had any Jline experience with this type of requirement?