【问题标题】:how to change .multiple in upgrade to rust clap v4如何在升级到 rust clap v4 时更改 .multiple
【发布时间】:2022-10-20 17:17:31
【问题描述】:

我正在尝试将 rust 代码从 clap v3.22.2 升级到 v4.0.8,并遇到了如何更改 Arg::multiple 的问题。这是一段代码:

Arg::new("relfs")
    required(true)
    multiple(true)

所以我得到一个错误

error[E0599]: no method named `multiple` found for struct `Arg` in the current scope
   --> src/bin/reo.rs:178:26
    |
178 |                         .multiple(true)
    |                          ^^^^^^^^ method not found in `Arg`

我已经尝试过Arg::action,如https://github.com/clap-rs/clap/issues/3772 中所写,但不能。 如何替换已弃用的multiple

【问题讨论】:

标签: rust clap


【解决方案1】:

最终changelog 帮助了我。有已更改的信息以及如何更新的信息。 就我而言,它已被弃用 multiple

【讨论】:

    猜你喜欢
    • 2015-06-12
    • 2014-09-29
    • 2022-12-20
    • 1970-01-01
    • 2022-11-17
    • 2020-08-24
    • 1970-01-01
    • 2017-09-21
    • 1970-01-01
    相关资源
    最近更新 更多