tags:

views:

7

answers:

0

I am trying to get JLine to do tab completion so I can enter something like the following:

commandname --arg1 value1 --arg2 value2

I am using the following code:

final List<Completor> completors = Arrays.asList(
    new SimpleCompletor("commandname "),
    new SimpleCompletor("--arg1"),
    new SimpleCompletor("--arg2"),
    new NullCompletor());

consoleReader.addCompletor(new ArgumentCompletor(completors));

But after I type the value2 tab completion stops.

(Suplementary question, can I validate value1 as a date using jline?)