Hi,
When using clap, I would like to have an argument that is of a fixed array size:
e.g
struct Args {
#[arg(
long = "stages",
help = "Comma-separated list of stages to run",
default_value = ["clear","configure","build","install"],
)]
stages: [&str; 4]
}
However, I keep getting the following error and am not quite sure why this won't work. Any help is appreciated.
error[E0277]: the trait bound `clap::builder::OsStr: From<[&str; 4]>` is not satisfied
--> src/cli_args.rs:21:25
|
21 | default_value = ["clear","configure","build","install"],
| ------------- ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ the trait `From<[&str; 4]>` is not implemented for `clap::builder::OsStr`
| |
| required by a bound introduced by this call