我想獲得的JLine做標籤完成,所以我可以像輸入下面的內容:的JLine多參數解析
commandname --arg1 value1 --arg2 value2
我使用下面的代碼:
final List<Completor> completors = Arrays.asList(
new SimpleCompletor("commandname "),
new SimpleCompletor("--arg1"),
new SimpleCompletor("--arg2"),
new NullCompletor());
consoleReader.addCompletor(new ArgumentCompletor(completors));
但經過我鍵入value2選項卡完成停止。
(Suplementary的問題,我可以使用的JLine驗證值1的日期?)
我認爲你已經在這裏切換了AggregateCompleter和ArgumentCompleter。你也不需要aggregatecompleter只有1 Completer。 – 2017-08-28 20:55:27