docs(README.md): add feature typed value macros

This commit is contained in:
Kevin K. 2015-04-14 14:44:44 -04:00
parent b8a0edc380
commit 90b7e76091

View file

@ -54,6 +54,7 @@ Below are a few of the features which `clap` supports, full descriptions and usa
* **Specific Value Sets**: Positional or Option Arguments can optionally define a specific set of allowed values (i.e. imagine a `--mode` option which may *only* have one of two values `fast` or `slow` such as `--mode fast` or `--mode slow`)
* **Default Values**: Although not specifically provided by `clap` you can achieve this exact functionality from Rust's `Option<&str>.unwrap_or("some default")` method
* **Get Version from Cargo.toml**: `clap` is fully compatible with Rust's `env!()` macro for automatically getting the version from your Cargo.toml. See `examples/09_AutoVersion.rs` for how to do this (Thanks to [jhelwig](https://github.com/jhelwig) for pointing this out)
* **Typed Values**: You can use several convenience macros provided by `clap` to get typed values (i.e. `i32`, `u8`, etc.) so long as the type you request implements `std::fmt::FrmStr` See the `examples/12_TypedValues.rs` or the documentation for more information.
## Quick Example