我正在尝试使用 Picocli 制作交互式 cli,并希望在完成 a(n) 操作/要求后显示一些选项。有没有办法在不使用 CommandSpec 的情况下做到这一点?
之前显示的选项
@Option(names = {"-c","--chooseDevice"}, description = {"Choose Devices"})
private boolean chooseDevice;
--
some code that will initialize a device
--
之后显示的选项
@Options(names = {,"-d", "--deviceCommand", description = "some device command")
private boolean deviceCommand;
输出应该是
//before choosing device
-c --chooseDevice "Choose Devices"
//after choosing device
-c --chooseDevice "Choose Devices"
-d --deviceCommand "some device command"