Skip to content

clap_derive: support fixed arrays as shortcut for number_of_values = N #1682

Open
@CreepySkeleton

Description

Transferred from: TeXitoi/structopt#349

It would be even better if fixed sized arrays or tuples with different value types would be supported directly:

#[derive(Clap)]
struct Args {
    #[clap(long)]
    range: [u32; N], // implies `required = true` and `number_of_values = N` 

    #[clap(long)]
    range: Option<[u32; N]>, // `number_of_values = N` 
}

Metadata

Assignees

Labels

A-deriveArea: #[derive]` macro APIC-enhancementCategory: Raise on the bar on expectationsS-waiting-on-designStatus: Waiting on user-facing design to be resolved before implementing

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions