cargo-examples
is a cargo subcommand that lets you run all examples in any locally cloned crate.
My main motivation for this tool is that when checking out a library or binary, I want to run all the examples so I can quickly grasp the inner workings of a crate interactively.
You can install this with cargo:
cargo install cargo-examples
Clone your favorite crate, cd
into the repo and run cargo examples
By default, cargo examples
will run all the examples in a crate in order.
There are cli options that you can use to modify how the examples are ran:
``` Cargo subcommand to run all examples for any locally cloned crate
USAGE: cargo examples [OPTIONS]
OPTIONS:
-f, --from --list
, or
--from
+ --print
-p, --print Print example name before running
-V, --version Print version information
```