Java 升级到2.x时,org.refcodes.console.ConsoleSugar中缺少switsh和helpSwitch方法

Java 升级到2.x时,org.refcodes.console.ConsoleSugar中缺少switsh和helpSwitch方法,java,scala,maven,console,Java,Scala,Maven,Console,我使用的是org.refcode.refcode-console版本1.1.9。当升级到2.0.4时,各种方法似乎不再存在 我的scala代码: val theHelp = helpSwitch("Shows this help") 编译时出现此错误:notfound:value-helpSwitch 使用switsh和StringOptionImpl时出现相同错误 在为这个maven工件从1.x迁移到2.x时,我应该如何替换它们?在主版本2中,ConsoleSugar中的所有“switch

我使用的是org.refcode.refcode-console版本1.1.9。当升级到2.0.4时,各种方法似乎不再存在

我的scala代码:

val theHelp =  helpSwitch("Shows this help")
编译时出现此错误:
notfound:value-helpSwitch

使用
switsh
StringOptionImpl
时出现相同错误

在为这个maven工件从1.x迁移到2.x时,我应该如何替换它们?

在主版本2中,ConsoleSugar中的所有“switch”(也称为switsh)方法都已重命名为“flag”。因此,“switsh”已重命名为“flag”,而“helpSwitch”已重命名为“helpFlag”。 对于StringOptionImpl,请改用“SpringOption”

因此,在提供的示例中,现在应该是:

val theHelp =  helpFlag("Shows this help")
此外,对于switsh方法,您需要添加一个'aAlias'参数作为第三个参数。例如:

val block = switsh("-w", "--wait", "Wait at the end of the Program")
需要变成什么样子

val block = flag("-w", "--wait", "wait", "Wait at the end of the Program")