简体   繁体   English

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

[英]switsh and helpSwitch methods missing from org.refcodes.console.ConsoleSugar when upgrading to 2.x

I was using org.refcode.refcodes-console version 1.1.9.我使用的是 org.refcode.refcodes-console 版本 1.1.9。 When upgrading to 2.0.4, it seems various methods no longer exist.升级到 2.0.4 时,似乎各种方法都不复存在了。

My scala code:我的 Scala 代码:

val theHelp =  helpSwitch("Shows this help")

I get this error when compiling: not found: value helpSwitch编译时出现此错误: not found: value helpSwitch

Same error when using switsh and StringOptionImpl .使用switshStringOptionImpl时出现同样的错误。

How should I replace them when migrating from 1.x to 2.x for this maven artifact?为这个 maven 工件从 1.x 迁移到 2.x 时,我应该如何替换它们?

All 'switch' (aka switsh) methods in ConsoleSugar have been renamed to 'flag' in major version 2. So 'switsh' has been renamed to 'flag' and 'helpSwitch' has been renamed to 'helpFlag'. ConsoleSugar 中的所有“switch”(又名 switsh)方法在主要版本 2 中都已重命名为“flag”。因此,“switsh”已重命名为“flag”,而“helpSwitch”已重命名为“helpFlag”。 For StringOptionImpl, use 'SpringOption' instead.对于 StringOptionImpl,请改用“SpringOption”。

So in the example provided, it should now be:所以在提供的例子中,它现在应该是:

val theHelp =  helpFlag("Shows this help")

Also, for the switsh method you would need to add a 'aAlias' parameter as the third parameter.此外,对于 switsh 方法,您需要添加一个“aAlias”参数作为第三个参数。 For example:例如:

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

would need to be something like become需要成为类似的东西

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

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

相关问题 从Elasticseatch 2.x升级到5.x - Upgrading from Elasticseatch 2.x to 5.x 从 Jersey 1.x 升级到 2.x - Upgrading from Jersey 1.x to 2.x 将Jersey客户端1.x升级到2.x时,UriBuilder上的AbstractMethodError - AbstractMethodError on UriBuilder when upgrading Jersey client 1.x to 2.x 从 Jersey Client 1.x 升级到 Jersey Client 2.x - Upgrading from Jersey Client 1.x to Jersey Client 2.x Elasticsearch - 从 2.x 升级到 7.x - 使用 TransportClient 和 Jest 进行双重写入 - Elasticsearch - Upgrading from 2.x to 7.x - Dual write using TransportClient and Jest 通用对象池 2.X 中缺少 GenericObjectPoolConfig 缺少 maxActive maxWait 和 whenExhaustedAction - GenericObjectPoolConfig missing maxActive maxWait and whenExhaustedAction missing from common pools 2.X Glassfish 2.x EJB库丢失 - Glassfish 2.x EJB library missing 将Grails 2.x应用升级到Grails 3.2.9时出现问题 - Problem upgrading grails 2.x app to Grails 3.2.9 从Hibernate 3升级到4.3.9后,缺少org.hibernate.ejb.event.EJB3MergeEventListener - org.hibernate.ejb.event.EJB3MergeEventListener missing after upgrading from Hibernate 3 to 4.3.9 "使用 OpenRewrite 超类访问检查将 Micronaut 2.X 升级到 3.X 失败" - Upgrading Micronaut 2.X to 3.X using OpenRewrite superclass access check failed
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM