Migrating clap-rs from 3-beta to 3-stable: `error: no method named `about` found for struct `Arg` in the current scope`

Migrating clap-rs from 3-beta to 3-stable: `error: no method named `about` found for struct `Arg` in the current scope`

所以我正在阅读文档,我可以看到该属性仍然存在 https://github.com/clap-rs/clap/blob/v3.1.6/examples/derive_ref/README.md#arg-attributes

我得到:

no method named `about` found for struct `Arg` in the current scope

我是不是漏掉了什么?

#[derive(Parser)]
#[clap(about("Entry point"))]
struct ForecastingCli {
    #[clap(
        short('c'),
        long,
        global(true),
        value_name("FILE"),
        about = "config file"
    )]
    config: Option<PathBuf>,
}

看起来 3.*.beta help() 被弃用了 about(),因为它们看起来多余,有点类似于 App::about()

但后来他们改变了主意,reverted3.0 发布之前改变了主意,删除了 about()

因此,只需使用 Arg::help() 即可。

long_help()long_about() 相同。