mirror of
https://github.com/clap-rs/clap
synced 2025-03-04 23:37:32 +00:00
Merge pull request #12 from epage/doctest
test: Compile example in README
This commit is contained in:
commit
2d41f7409e
4 changed files with 5 additions and 4 deletions
|
@ -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
|
||||
|
|
2
Makefile
2
Makefile
|
@ -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
|
||||
|
||||
|
|
|
@ -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
|
||||
|
|
|
@ -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(
|
||||
|
|
Loading…
Add table
Reference in a new issue