-
-
Notifications
You must be signed in to change notification settings - Fork 1.1k
Open
Labels
A-deriveArea: #[derive]` macro APIArea: #[derive]` macro APIC-enhancementCategory: Raise on the bar on expectationsCategory: Raise on the bar on expectations
Description
Clap Version
4.5.42
Describe your use case
Due to limitations of clap, it's not always possible to get desired type from CLI: example.
Same thing applies to serde, but there is convenient macro serde_with::TryFromInto
, which allows in combination with #[serde(flatten)]
to map values into desired type.
Describe the solution you'd like
Something like serde_with::TryFromInto
, but for clap.
Additional Context
It's difficult to transform CLI input to different type, especially if there are multiple nested subcommands. Right now it requires a lot of boilerplate.
Metadata
Metadata
Assignees
Labels
A-deriveArea: #[derive]` macro APIArea: #[derive]` macro APIC-enhancementCategory: Raise on the bar on expectationsCategory: Raise on the bar on expectations