【发布时间】:2017-08-29 04:54:43
【问题描述】:
我正在尝试让 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 选项卡后完成停止。
(补充问题,我可以使用 jline 将 value1 验证为日期吗?)
【问题讨论】: