Merge pull request #12 from epage/doctest

test: Compile example in README
This commit is contained in:
Ed Page 2021-11-17 21:11:48 -06:00 committed by GitHub
commit 2d41f7409e
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
4 changed files with 5 additions and 4 deletions

View file

@ -38,7 +38,7 @@ include = [
]
[package.metadata.docs.rs]
features = ["yaml", "regex", "unstable-replace", "unstable-multicall", "unstable-grouped"]
features = ["doc"]
[features]
default = [
@ -51,6 +51,7 @@ default = [
"unicode",
]
debug = ["clap_derive/debug", "backtrace"] # Enables debug messages
doc = ["yaml", "regex", "unstable-replace", "unstable-multicall", "unstable-grouped"] # for docs.rs
# Used in default
std = ["indexmap/std"] # support for no_std in a backwards-compatible way

View file

@ -14,7 +14,7 @@ _FEATURES = minimal default wasm full release
_FEATURES_minimal = --no-default-features --features "std cargo"
_FEATURES_default =
_FEATURES_wasm = --features "yaml regex unstable-replace unstable-multicall unstable-grouped"
_FEATURES_full = --features "wrap_help yaml regex unstable-replace unstable-multicall unstable-grouped"
_FEATURES_full = --features "wrap_help yaml regex unstable-replace unstable-multicall unstable-grouped doc"
_FEATURES_debug = ${_FEATURES_full} --features debug
_FEATURES_release = ${_FEATURES_full} --release

View file

@ -132,7 +132,7 @@ clap = "3.0.0-beta.5"
The first example shows the simplest way to use `clap`, by defining a struct. If you're familiar with the `structopt` crate you're in luck, it's the same! (In fact it's the exact same code running under the covers!)
```rust,ignore
```rust,no_run
// (Full example with detailed comments in examples/01d_quick_example.rs)
//
// This example demonstrates clap's full 'custom derive' style of creating arguments which is the

View file

@ -5,7 +5,7 @@
#![doc(html_logo_url = "https://clap.rs/images/media/clap.png")]
#![doc(html_root_url = "https://docs.rs/clap/3.0.0-beta.5")]
#![doc = include_str!("../README.md")]
#![cfg_attr(feature = "doc", doc = include_str!("../README.md"))]
//! <https://github.com/clap-rs/clap>
#![crate_type = "lib"]
#![deny(