Using the starter project:
- find where
bumblefoot
is and replace it with the name of your project.$ rg bumblefoot
- This is a dual library and binary project and builds both by default.
Compile a CLI:
$ cargo build
Compile a library:
$ cargo build --no-default-features
Project structure
bin/
cmd/
default.rs <-- the 'bare' command `$ bumblefoot`
validate.rs <-- `$bumblefoot validate`
bumblefoot.rs <-- main CLI routing logic, add new commands here declaratively
data.rs <-- aka 'types.rs'
lib.rs <-- export some public API
runner.rs <-- implement some logic here
Simpler structure You can convert the project to be simpler and CLI only on account of power and flexibility.
- Copy the contents of
default.rs
intobumblefoot.rs
and rename intomain.rs
. - Drop
main.rs
undersrc/
and deletebin/
. - Remove the
[[features]]
and[[bin]]
sections fromCargo.toml
- Fix
use
issues and stale code errors inmain.rs
.
This should be the result:
bumblefoot/
main.rs <-- main CLI routing logic + default command
data.rs <-- aka 'types.rs'
lib.rs <-- export some public API
runner.rs <-- implement some logic here
xtask
You have xtask preconfigured. It's a best-practice, boilerplate code that allows you to use cargo xtask <your task>
. A kind of rust-native make.
You can use it to codify any of your tasks for CI or development.
In it you have two tasks preconfigured:
dual
- convert this crate to a dual build (library and CLI)simple
- convert this crate to a simple layout
These will work only when you're starting out because they apply fresh templated code. Once you start building, they'll probably not be useful anymore.
✅ bumblefoot
🤠bumblefoot
🤖 bumblefoot
🚀 Quick Start
Grab a release from releases, or install via Homebrew:
brew tap jondot/tap && brew install bumblefoot
Using bumblefoot
Thanks
To all Contributors - you make this happen, thanks!
Copyright
Copyright (c) 2021 @jondot. See LICENSE for further details.