serde-clap-deserialize

Crates.ioserde-clap-deserialize
lib.rsserde-clap-deserialize
version0.1.0
sourcesrc
created_at2024-03-14 23:41:08.853796
updated_at2024-03-14 23:41:08.853796
descriptionProc macro for setting serde/clap defaults
homepage
repositoryhttps://github.com/voximity/serde-clap-deserialize
max_upload_size
id1174259
size5,106
Zander (voximity)

documentation

README

serde-clap-deserialize

Small proc macro to add both default values to clap and serde. Inspired by serde-inline-default.

#[serde_clap_deserialize]
#[derive(Deserialize, Parser)]
struct MyArgs {
    #[serde_clap_deserialize(8)]
    foo: u32,
}

// MyArgs can now be serde-deserialized or clap-parsed
// and `foo` will have a default value of 8
Commit count: 0

cargo fmt