clap/examples/keyvalue_derive.md
Ed Page 32b5520ff1 docs: Call out features used in root examples
mitsuhiko immediately jumped into the examples and got tripped up by the
lack of documentation on feature flags needed.

I limited this to just the root ones because the rest are in a more
proper tutorial that steps through it all.
2021-12-08 16:46:49 -06:00

641 B

Jump to source

This requires enabling the derive feature flag.

$ keyvalue_derive --help
clap 

USAGE:
    keyvalue_derive[EXE] [OPTIONS]

OPTIONS:
    -D <DEFINES>        
    -h, --help          Print help information
$ keyvalue_derive -D Foo=10 -D Alice=30
Args { defines: [("Foo", 10), ("Alice", 30)] }
$ keyvalue_derive -D Foo
? failed
error: Invalid value for '-D <DEFINES>': invalid KEY=value: no `=` found in `Foo`

For more information try --help
$ keyvalue_derive -D Foo=Bar
? failed
error: Invalid value for '-D <DEFINES>': invalid digit found in string

For more information try --help