Skip to content
This repository has been archived by the owner on Oct 16, 2021. It is now read-only.

BrandtM/cargo-example

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

21 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

cargo-example is an easy-to-use example runner for rust crates.

About

cargo-example aims to provide a simple interface to running examples of any valid rust crate. Currently there is no short way to do this. In order to run examples you'll always have to manually clone or download the repository of the crate whose examples you wish to run.
For newcomers to the rust language the --example feature of cargo run might even remain completely unknown for quite some time.
This crate aims to simplify this process. All the messy cloning is abstracted away from the end user.

Usage

  1. Run cargo install cargo-example
  2. Run any examples with cargo example <crate> ...args
  • <crate> is the target crate whose examples you wish to run
  • args is a list of arguments that will be forwarded to the example

Example gif

In development

Just use cargo run example <crate> ...args. It has to be done this way due to the way that cargo finds its subcommands.

Inspiration

I wouldn't have made this project if it wasn't for the excellent GitHub Project "request-for-implementation" by dtolnay. Specifically this issue.

Early stages

This entire project is still in its infancy. It might not work for you. But you can help. Just open up a new GitHub issue if you find an error or would like to request a feature or a change.

About

Cargo subcommand to run examples of any published crate easily

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages