Crates.io | scaffold |
lib.rs | scaffold |
version | 0.5.1 |
source | src |
created_at | 2019-11-11 22:13:56.805002 |
updated_at | 2021-07-30 13:35:21.896731 |
description | Quickly add dependencies to your Rust project. |
homepage | https://github.com/segfaultsourcery/scaffold |
repository | |
max_upload_size | |
id | 180366 |
size | 38,669 |
I find myself always scouring the internet or looking through old projects to find the same dependencies over and over. This is a tool I made to automate that process.
The help screen really says it all.
scaffold 0.3.0
Quickly add dependencies to your Rust project.
USAGE:
scaffold [FLAGS] [OPTIONS] <SUBCOMMAND>
FLAGS:
-a, --ask Ask before each dependency
-h, --help Prints help information
-t, --tilde Use tilde versioning. Instead of "1.0.104", the version becomes "~1.0". See: https://doc.rust-
lang.org/cargo/reference/specifying-dependencies.html#tilde-requirements
-V, --version Prints version information
-v, --verbose Be more verbose
OPTIONS:
-g, --groups <groups-path> [default: ~/.config/scaffold/groups.toml]
-p, --path <toml-path> [default: Cargo.toml]
SUBCOMMANDS:
add Add groups to your project.
help Prints this message or the help of the given subcommand(s)
list List all available groups.
By default, scaffold will look for groups in ~/.config/scaffold/groups.toml
.
If this file doesn't exist, it will be created.
For the sake of convenience, groups.toml
is a toml file, with the intent of looking and feeling like Cargo.toml
.
Example:
[json]
serde_derive = "*"
serde_json = "*"
serde = { version = "*", features = ["derive"] }
[cli]
structopt = "*"
config = "*"
shellexpand = "*"
Note that if the version is starred, then scaffold will try to determine the latest version.
You can list all your available groups:
$ scaffold list
Result:
cli
config = "0.9.3"
shellexpand = "1.0.0"
structopt = "0.3.4"
json
serde = { features = ["derive"], version = "1.0.102" }
serde_derive = "1.0.102"
serde_json = "1.0.41"
To add groups simply say:
$ scaffold --verbose add json
Result:
Adding serde = { features = ["derive"], version = "1.0.102" }.
Adding serde_derive = "1.0.102".
Adding serde_json = "1.0.41".
You can add more than one at the same time:
$ scaffold --verbose add json cli
Result:
Adding serde = { features = ["derive"], version = "1.0.102" }.
Adding serde_derive = "1.0.102".
Adding serde_json = "1.0.41".
Adding config = "0.9.3".
Adding shellexpand = "1.0.0".
Adding structopt = "0.3.4".
You can also tell it to ask you before each crate to see if you want it:
$ scaffold --ask --verbose add json cli
Result:
Add config = "0.9.3"? [Y/n] y
Adding config = "0.9.3".
Add shellexpand = "1.0.0"? [Y/n] n
Add structopt = "0.3.4"? [Y/n] y
Adding structopt = "0.3.4".