1 unstable release

0.1.0 Mar 14, 2024

#1736 in Procedural macros

MIT license

5KB
50 lines

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

Dependencies

~245–690KB
~16K SLoC