clap/examples/keyvalue_derive.md
Ed Page c99adcc6c9 docs: Add key-value derive example
This is carried over from the clap_derive examples.  Looking over the
other examples, I feel like they are covered by other examples or by the
derive reference.  We should call out deny missing docs though.
2021-12-07 19:01:55 -06:00

586 B

Jump to source

$ 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